dont simplify everything away, ever
This commit is contained in:
parent
f9ccbd7b95
commit
3dc32aff3f
1 changed files with 3 additions and 2 deletions
|
@ -177,9 +177,10 @@ class MapHistory:
|
|||
def simplify(self):
|
||||
logging.info('simplify!')
|
||||
# remove updates that have no longer any array cells
|
||||
new_updates = ((update, (self.data == i)) for i, update in enumerate(self.updates))
|
||||
new_updates = ((i, update, (self.data == i)) for i, update in enumerate(self.updates))
|
||||
logging.info('before: %s' % (self.updates, ))
|
||||
self.updates, new_affected = zip(*((update, affected) for update, affected in new_updates if affected.any()))
|
||||
self.updates, new_affected = zip(*((update, affected) for i, update, affected in new_updates
|
||||
if i == 0 or affected.any()))
|
||||
logging.info('after: %s' % (self.updates, ))
|
||||
for i, affected in enumerate(new_affected):
|
||||
self.data[affected] = i
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue