[pypy-commit] pypy default: this isn't rpython, so it can be a set

alex_gaynor noreply at buildbot.pypy.org
Sat Nov 10 23:24:22 CET 2012


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r58821:7f3bb1d0cc64
Date: 2012-11-10 14:24 -0800
http://bitbucket.org/pypy/pypy/changeset/7f3bb1d0cc64/

Log:	this isn't rpython, so it can be a set

diff --git a/pypy/rlib/rgc.py b/pypy/rlib/rgc.py
--- a/pypy/rlib/rgc.py
+++ b/pypy/rlib/rgc.py
@@ -313,7 +313,7 @@
     return True
 has_gcflag_extra._subopnum = 1
 
-_gcflag_extras = {}
+_gcflag_extras = set()
 
 def get_gcflag_extra(gcref):
     "NOT_RPYTHON"
@@ -325,9 +325,9 @@
     "NOT_RPYTHON"
     assert gcref   # not NULL!
     try:
-        del _gcflag_extras[gcref]
+        _gcflag_extras.remove(gcref)
     except KeyError:
-        _gcflag_extras[gcref] = None
+        _gcflag_extras.add(gcref)
 toggle_gcflag_extra._subopnum = 3
 
 def assert_no_more_gcflags():


More information about the pypy-commit mailing list