Rev 4413: Slightly simplify an if check. in lp:///~jameinel/bzr/bencode_serializer

John Arbash Meinel john at arbash-meinel.com
Thu Jun 4 18:21:43 BST 2009


At lp:///~jameinel/bzr/bencode_serializer

------------------------------------------------------------
revno: 4413
revision-id: john at arbash-meinel.com-20090604172124-xjaub39iym26c9fm
parent: john at arbash-meinel.com-20090604171229-kbgfatt63y3u3uh1
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: bencode_serializer
timestamp: Thu 2009-06-04 12:21:24 -0500
message:
  Slightly simplify an if check.
-------------- next part --------------
=== modified file 'bzrlib/_bencode_pyx.pyx'
--- a/bzrlib/_bencode_pyx.pyx	2009-06-04 17:12:29 +0000
+++ b/bzrlib/_bencode_pyx.pyx	2009-06-04 17:21:24 +0000
@@ -154,8 +154,7 @@
         if next_tail == NULL or next_tail[0] != c':':
             raise ValueError('string len not terminated by ":"')
         # strtol allows leading zeros, so validate that we don't have that
-        if (self.tail[0] == c'0'
-            and (n != 0 or (next_tail - self.tail != 1))):
+        if self.tail[0] == c'0' and next_tail - self.tail != 1:
             raise ValueError('leading zeros are not allowed')
         D_UPDATE_TAIL(self, next_tail - self.tail + 1)
         if n == 0:



More information about the bazaar-commits mailing list