mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-25 11:18:27 +08:00
embedding_map: avoid key 0
Object key 0 is reserved for builtin exceptions.
This commit is contained in:
parent
76132c95c2
commit
af1b6d8d33
@ -39,7 +39,7 @@ class EmbeddingMap:
|
||||
obj_id = id(obj)
|
||||
if obj_id in self.object_inverse_map:
|
||||
return self.object_inverse_map[obj_id]
|
||||
key = len(self.object_map)
|
||||
key = len(self.object_map) + 1
|
||||
self.object_map[key] = obj
|
||||
self.object_inverse_map[obj_id] = key
|
||||
return key
|
||||
|
Loading…
Reference in New Issue
Block a user