@@ -373,54 +373,6 @@ impl TickIndex {
373
373
}
374
374
}
375
375
}
376
-
377
- /// Find the closest lower active tick index
378
- pub fn find_closest_lower_active < Ops , AccountIdType > ( & self , ops : & Ops ) -> Option < Self >
379
- where
380
- AccountIdType : Eq ,
381
- Ops : SwapDataOperations < AccountIdType > ,
382
- {
383
- // TODO: Implement without iteration
384
- let mut current_index = * self ;
385
- loop {
386
- if current_index. get ( ) < Self :: MIN . get ( ) {
387
- return None ;
388
- }
389
- if ops. get_tick_by_index ( current_index) . is_some ( ) {
390
- return Some ( current_index) ;
391
- }
392
-
393
- // Create a new index with value one less
394
- match current_index. prev ( ) {
395
- Ok ( next_index) => current_index = next_index,
396
- Err ( _) => return None , // Return None if we go out of bounds
397
- }
398
- }
399
- }
400
-
401
- /// Find the closest higher active tick index
402
- pub fn find_closest_higher_active < Ops , AccountIdType > ( & self , ops : & Ops ) -> Option < Self >
403
- where
404
- AccountIdType : Eq ,
405
- Ops : SwapDataOperations < AccountIdType > ,
406
- {
407
- // TODO: Implement without iteration
408
- let mut current_index = * self ;
409
- loop {
410
- if current_index. get ( ) > Self :: MAX . get ( ) {
411
- return None ;
412
- }
413
- if ops. get_tick_by_index ( current_index) . is_some ( ) {
414
- return Some ( current_index) ;
415
- }
416
-
417
- // Create a new index with value one more
418
- match current_index. next ( ) {
419
- Ok ( next_index) => current_index = next_index,
420
- Err ( _) => return None , // Return None if we go out of bounds
421
- }
422
- }
423
- }
424
376
}
425
377
426
378
/// A bitmap representation of a tick index position across the three-layer structure
0 commit comments