dont simplify everything away, ever
@@ -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
