From a5e1da0b92cd5ae45d1a87756a1f0827af5feecd Mon Sep 17 00:00:00 2001 From: pca006132 Date: Sat, 5 Mar 2022 00:27:23 +0800 Subject: [PATCH] nac3artiq/demo/embedding_map: avoid key 0 Object key 0 is reserved for builtin exceptions. --- nac3artiq/demo/embedding_map.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nac3artiq/demo/embedding_map.py b/nac3artiq/demo/embedding_map.py index 9f4b877a..74b9aa1a 100644 --- a/nac3artiq/demo/embedding_map.py +++ b/nac3artiq/demo/embedding_map.py @@ -33,7 +33,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