repository: fix assert expression to not have a side effect

lgtm:
This 'assert' statement contains an expression which may have side effects.
This commit is contained in:
Thomas Waldmann 2017-07-22 01:51:19 +02:00
parent 98090102c2
commit b7b428edc2
1 changed files with 2 additions and 1 deletions

View File

@ -642,7 +642,8 @@ class Repository:
# get rid of the old, sparse, unused segments. free space.
for segment in unused:
logger.debug('complete_xfer: deleting unused segment %d', segment)
assert self.segments.pop(segment) == 0, 'Corrupted segment reference count - corrupted index or hints'
count = self.segments.pop(segment)
assert count == 0, 'Corrupted segment reference count - corrupted index or hints'
self.io.delete_segment(segment)
del self.compact[segment]
unused = []