Commits

Alex Gaynor committed c4debf5

Use a set here -- not a dict with bogus fields

  • Participants
  • Parent commits fc6598a

Comments (0)

Files changed (1)

File rpython/rtyper/annlowlevel.py

         self.delayedreprs = {}
         self.delayedconsts = []
         self.delayedfuncs = []
-        self.newgraphs = {}
+        self.newgraphs = set()
 
     def getgraph(self, ll_function, args_s, s_result):
         # get the graph of the mix-level helper ll_function and prepare it for
             ann.annotated[graph.returnblock] = graph
             s_function = bk.immutablevalue(ll_function)
             bk.emulate_pbc_call(graph, s_function, args_s)
-            self.newgraphs[graph] = True
+            self.newgraphs.add(graph)
         ann.complete_helpers(self.policy)
         for ll_function, graph, args_s, s_result in self.pending:
             s_real_result = ann.binding(graph.getreturnvar())
                                 (graph, s_result, s_real_result))
         del self.pending[:]
         for graph in translator.graphs[original_graph_count:]:
-            self.newgraphs[graph] = True
+            self.newgraphs.add(graph)
 
     def finish_rtype(self):
         rtyper = self.rtyper
             p._become(repr.convert_const(obj))
         rtyper.call_all_setups()
         for p, graph in self.delayedfuncs:
-            self.newgraphs[graph] = True
+            self.newgraphs.add(graph)
             real_p = rtyper.getcallable(graph)
             REAL = lltype.typeOf(real_p).TO
             FUNCTYPE = lltype.typeOf(p).TO
         del self.delayedconsts[:]
         del self.delayedfuncs[:]
         for graph in translator.graphs[original_graph_count:]:
-            self.newgraphs[graph] = True
+            self.newgraphs.add(graph)
 
     def backend_optimize(self, **flags):
         # only optimize the newly created graphs
         from rpython.translator.backendopt.all import backend_optimizations
         translator = self.rtyper.annotator.translator
-        newgraphs = self.newgraphs.keys()
+        newgraphs = list(self.newgraphs)
         backend_optimizations(translator, newgraphs, secondary=True,
                               inline_graph_from_anywhere=True, **flags)
         self.newgraphs.clear()