Browse Source

Minor tweaks in Keyset.

Stefano Cossu 6 years ago
parent
commit
dd907931b2
1 changed files with 2 additions and 2 deletions
  1. 2 2
      lakesuperior/model/structures/keyset.pyx

+ 2 - 2
lakesuperior/model/structures/keyset.pyx

@@ -26,7 +26,7 @@ cdef class Keyset:
     data block, so e.g. bulk removal and intersection are much more efficient
     data block, so e.g. bulk removal and intersection are much more efficient
     than individual record operations.
     than individual record operations.
     """
     """
-    def __cinit__(self, size_t capacity=0, expand_ratio=.75):
+    def __cinit__(self, size_t capacity=0, float expand_ratio=.75):
         """
         """
         Initialize and allocate memory for the data set.
         Initialize and allocate memory for the data set.
 
 
@@ -58,7 +58,7 @@ cdef class Keyset:
         """
         """
         Place the cursor at a certain index, 0 by default.
         Place the cursor at a certain index, 0 by default.
         """
         """
-        self.cur = idx
+        self.cur = min(idx, self.free_i)
 
 
 
 
     cdef size_t size(self):
     cdef size_t size(self):