Skip to content

Commit

Permalink
Use a better name for the output of the FFI verify call to signal its…
Browse files Browse the repository at this point in the history
… constant/global nature.
  • Loading branch information
jamadden committed May 19, 2015
1 parent f711686 commit 8146702
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions persistent/ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def __iter__(self):
with open(os.path.join(this_dir, 'ring.h')) as f:
ffi.cdef(f.read())

ring = ffi.verify("""
_FFI_RING = ffi.verify("""
#include "ring.c"
""", include_dirs=[this_dir])

Expand Down Expand Up @@ -191,20 +191,20 @@ def __contains__(self, pobj):

def add(self, pobj):
node = ffi.new("CPersistentRing*")
ring.ring_add(self.ring_home, node)
_FFI_RING.ring_add(self.ring_home, node)
self.ring_to_obj[node] = pobj
_OSA(pobj, '_Persistent__ring', node)

def delete(self, pobj):
its_node = getattr(pobj, '_Persistent__ring', None)
our_obj = self.ring_to_obj.pop(its_node, None)
if its_node is not None and our_obj is not None and its_node.r_next:
ring.ring_del(its_node)
_FFI_RING.ring_del(its_node)
return 1

def move_to_head(self, pobj):
node = _OGA(pobj, '_Persistent__ring')
ring.ring_move_to_head(self.ring_home, node)
_FFI_RING.ring_move_to_head(self.ring_home, node)

def delete_all(self, indexes_and_values):
for _, value in indexes_and_values:
Expand Down

0 comments on commit 8146702

Please sign in to comment.