Core: fix exceptions coming from LocationStore (#4358)

* Speedups: add instructions for ASAN

* Speedups: move typevars out of classes

* Speedups, NetUtils: raise correct exceptions

* Speedups: double-check malloc

* Tests: more LocationStore tests
This commit is contained in:
black-sliver
2024-12-10 20:09:36 +01:00
committed by GitHub
parent f79657b41a
commit 3fb0b57d19
4 changed files with 84 additions and 20 deletions

View File

@@ -410,6 +410,8 @@ class _LocationStore(dict, typing.MutableMapping[int, typing.Dict[int, typing.Tu
checked = state[team, slot]
if not checked:
# This optimizes the case where everyone connects to a fresh game at the same time.
if slot not in self:
raise KeyError(slot)
return []
return [location_id for
location_id in self[slot] if