##// END OF EJS Templates
fix UnboundLocalError, refactor a bit...
Benoit Boissinot -
r5453:9d77f2b4 default
parent child Browse files
Show More
@@ -62,10 +62,9 b' def compress(text):'
62 62 if not text:
63 63 return ("", text)
64 64 l = len(text)
65 bin = None
65 66 if l < 44:
66 if text[0] == '\0':
67 return ("", text)
68 return ('u', text)
67 pass
69 68 elif l > 1000000:
70 69 # zlib makes an internal copy, thus doubling memory usage for
71 70 # large files, so lets do this in pieces
@@ -81,7 +80,7 b' def compress(text):'
81 80 bin = "".join(p)
82 81 else:
83 82 bin = _compress(text)
84 if len(bin) > l:
83 if bin is None or len(bin) > l:
85 84 if text[0] == '\0':
86 85 return ("", text)
87 86 return ('u', text)
General Comments 0
You need to be logged in to leave comments. Login now