File tree Expand file tree Collapse file tree
storage/fuzz/fuzz_targets Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -162,8 +162,15 @@ fn fuzz(input: FuzzInput) {
162162 }
163163
164164 IndexOperation :: CursorInsert { key, value } => {
165- // Just use regular insert - simpler and avoids borrow issues
166- index. insert ( key, * value) ;
165+ if index. get ( key) . next ( ) . is_some ( ) {
166+ let mut cursor = index. get_mut ( key) . unwrap ( ) ;
167+ if cursor. next ( ) . is_some ( ) {
168+ cursor. insert ( * value) ;
169+ let _ = cursor. next ( ) ;
170+ }
171+ } else {
172+ index. insert ( key, * value) ;
173+ }
167174 }
168175 }
169176 }
Original file line number Diff line number Diff line change @@ -162,8 +162,15 @@ fn fuzz(input: FuzzInput) {
162162 }
163163
164164 IndexOperation :: CursorInsert { key, value } => {
165- // Just use regular insert - simpler and avoids borrow issues
166- index. insert ( key, * value) ;
165+ if index. get ( key) . next ( ) . is_some ( ) {
166+ let mut cursor = index. get_mut ( key) . unwrap ( ) ;
167+ if cursor. next ( ) . is_some ( ) {
168+ cursor. insert ( * value) ;
169+ let _ = cursor. next ( ) ;
170+ }
171+ } else {
172+ index. insert ( key, * value) ;
173+ }
167174 }
168175 }
169176 }
You can’t perform that action at this time.
0 commit comments