Whole file
benmoran56/esper
The author described this change as “Fix World.clear_database() not accounting for lazily deleted entities.”. It counts as a record because the check below fails on the code as it stood at 32b47987d and passes on 05dee82b0, with nothing else changed between the two runs.
Projectbenmoran56/esper
Fix saved2018-01-06
Sharing licenceMIT · LICENSE
Change size+1 −0
What the code was meant to do, written into the code itself as a save note
Fix World.clear_database() not accounting for lazily deleted entities.
The change
| 39 | 39 | def clear_database(self): | |
| 40 | 40 | """Remove all Entities and Components from the World.""" | |
| 41 | 41 | self._next_entity_id = 0 | |
| 42 | + | self._dead_entities.clear() | |
| 42 | 43 | self._components.clear() | |
| 43 | 44 | self._entities.clear() | |
| 44 | 45 |
The check that tells the two apart
fail→pass·tests/test_world.py::test_clear_database
Check file tests/test_world.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it32b47987d0a1ed37fa753ac9f1f1b618580655ab
Broken version dated2017-10-22
Moduleesper
Units changedWorld
Fingerprintb72f1b9eaf8151f7
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.