Snapshot.cursor.list.remove.loop: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/scan/Snapshot.bend as Snapshot Lines 968-1000 of mylsm-lsm-store@0.6.0.1/src/scan/Snapshot.bend: https://jend.leeeet.dev/read.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/Snapshot.bend&start_line=968&end_line=1000 import Base def cursor.list.remove.loop( fuel: Nat, state: CursorListRemoveState ) -> CursorListRemoveDecision: match fuel: case 0n: cursor.list.remove.exhausted(state) case 1n+rest: match state: case CursorSearch{cursors, cursor_id, prefix}: match cursors: case Nil{}: CursorListMissing{cursor.list.restore(prefix, Nil{})} case Con{resource, tail}: cursor.list.remove.loop(rest, CursorCompareCopies{ cursor.resource.duplicate(resource), tail, u32.duplicate(cursor_id), prefix}) case CursorCompareCopies{copies, tail, cursor_ids, prefix}: match copies: case (for_check, for_update): match for_check: case CursorResource{id, _}: match cursor_ids: case (current_id, next_id): cursor.list.remove.loop(rest, CursorCompare{U32.is_eq(id, current_id), for_update, tail, next_id, prefix}) case CursorCompare{matches, resource, tail, cursor_id, prefix}: match matches: case True{}: CursorListRemoved{prefix, resource, tail} case False{}: cursor.list.remove.loop(rest, CursorSearch{tail, cursor_id, Con{resource, prefix}}) Uses (12): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/Snapshot.bend&name=CursorListRemoveDecision https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/Snapshot.bend&name=CursorListRemoveState https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/Snapshot.bend&name=CursorResource https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/Snapshot.bend&name=cursor.list.remove.exhausted https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/Snapshot.bend&name=cursor.list.restore https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/Snapshot.bend&name=cursor.resource.duplicate https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/Snapshot.bend&name=u32.duplicate