@@ -230,6 +230,16 @@ cdef class IndexEngine:
230
230
def __sizeof__(self ) -> int:
231
231
return self.sizeof()
232
232
233
+ cpdef _update_from_sliced(self , IndexEngine other , reverse: bool ):
234
+ self .unique = other.unique
235
+ self .need_unique_check = other.need_unique_check
236
+ if not other.need_monotonic_check and (
237
+ other.is_monotonic_increasing or other.is_monotonic_decreasing):
238
+ self .need_monotonic_check = other.need_monotonic_check
239
+ # reverse=True means the index has been reversed
240
+ self .monotonic_inc = other.monotonic_dec if reverse else other.monotonic_inc
241
+ self .monotonic_dec = other.monotonic_inc if reverse else other.monotonic_dec
242
+
233
243
@property
234
244
def is_unique (self ) -> bool:
235
245
if self.need_unique_check:
@@ -892,6 +902,16 @@ cdef class SharedEngine:
892
902
# for compat with IndexEngine
893
903
pass
894
904
905
+ cpdef _update_from_sliced(self , ExtensionEngine other, reverse: bool ):
906
+ self .unique = other.unique
907
+ self .need_unique_check = other.need_unique_check
908
+ if not other.need_monotonic_check and (
909
+ other.is_monotonic_increasing or other.is_monotonic_decreasing):
910
+ self .need_monotonic_check = other.need_monotonic_check
911
+ # reverse=True means the index has been reversed
912
+ self .monotonic_inc = other.monotonic_dec if reverse else other.monotonic_inc
913
+ self .monotonic_dec = other.monotonic_inc if reverse else other.monotonic_dec
914
+
895
915
@property
896
916
def is_unique (self ) -> bool:
897
917
if self.need_unique_check:
0 commit comments