[Zope-Checkins] CVS: Releases/Zope/lib/python/ZTUtils - Tree.py:1.15

Evan Simpson evan@zope.com
Fri, 25 Apr 2003 12:32:03 -0400


Update of /cvs-repository/Releases/Zope/lib/python/ZTUtils
In directory cvs.zope.org:/tmp/cvs-serv30284

Modified Files:
	Tree.py 
Log Message:
Fix for Collector #868.  It looks like the filterChildren issue was already
addressed, so I just improved encodeExpansion()'s compression behavior.


=== Releases/Zope/lib/python/ZTUtils/Tree.py 1.14 => 1.15 ===
--- Releases/Zope/lib/python/ZTUtils/Tree.py:1.14	Mon Oct  7 15:43:14 2002
+++ Releases/Zope/lib/python/ZTUtils/Tree.py	Fri Apr 25 12:32:02 2003
@@ -271,8 +271,10 @@
         node.expansion_number = n
         n = n + 1
     result = ':'.join(steps)
-    if compress:
-        result = ':'  + b2a(zlib.compress(result, 9))
+    if compress and len(result) > 2:
+        zresult = ':'  + b2a(zlib.compress(result, 9))
+        if len(zresult) < len(result):
+            result = zresult
     return result
 
 def decodeExpansion(s, nth=None):