From f711686eb756c9ddde72afce9cd2d212204cd6f0 Mon Sep 17 00:00:00 2001 From: Jason Madden Date: Tue, 19 May 2015 08:15:25 -0500 Subject: [PATCH] Remove PyPy enumerate workaround in _DequeRing; PyPy should be using _CFFIRing. --- persistent/ring.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/persistent/ring.py b/persistent/ring.py index d705805..0fe670f 100644 --- a/persistent/ring.py +++ b/persistent/ring.py @@ -124,13 +124,11 @@ def delete(self, pobj): # uses equality semantics and we don't want to call the persistent # object's __eq__ method (which might wake it up just after we # tried to ghost it) - i = 0 # Using a manual numeric counter instead of enumerate() is much faster on PyPy - for o in self.ring: + for i, o in enumerate(self.ring): if o is pobj: del self.ring[i] self.ring_oids.discard(pobj._p_oid) return 1 - i += 1 def move_to_head(self, pobj): self.delete(pobj)