Author: Alex Gaynor <alex.gay...@gmail.com> Branch: Changeset: r68347:c4debf511df5 Date: 2013-11-30 15:55 -0600 http://bitbucket.org/pypy/pypy/changeset/c4debf511df5/
Log: Use a set here -- not a dict with bogus fields diff --git a/rpython/rtyper/annlowlevel.py b/rpython/rtyper/annlowlevel.py --- a/rpython/rtyper/annlowlevel.py +++ b/rpython/rtyper/annlowlevel.py @@ -135,7 +135,7 @@ 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 @@ -235,7 +235,7 @@ 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()) @@ -246,7 +246,7 @@ (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 @@ -260,7 +260,7 @@ 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 @@ -273,13 +273,13 @@ 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() _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit