]> arthur.barton.de Git - bup.git/blobdiff - lib/bup/hashsplit.py
hashsplit: avoid cat_bytes() if possible
[bup.git] / lib / bup / hashsplit.py
index 0ae6acdb669a624a58688e3bc760ba01d0a35ddd..01e11a67c6ea89884edb8fd6e1aa9373d0fa4b58 100644 (file)
@@ -29,7 +29,10 @@ class Buf:
         self.start = 0
 
     def put(self, s):
-        if s:
+        if not self.data:
+            self.data = s
+            self.start = 0
+        elif s:
             remaining = len(self.data) - self.start
             self.data = cat_bytes(self.data, self.start, remaining,
                                   s, 0, len(s))