multi_index_map
multi_index_map copied to clipboard
Fix non-unique iteration over slab holes
- Replace nth-based logic with key-matching over iter_mut for get_mut_by_
- Use two-pass keyed access for update_by_/modify_by_ to satisfy borrow rules and keep indexes consistent
- Add extensive comments explaining reasoning and prior errors (E0499, closure escape)
- Add regression tests: modify/update/get_mut over non-unique indices after holes; absent-key behaviors"
@lun3x First, I'd like to thank you for creating this project and making it open-source. We attempted to use it in https://github.com/sigp/anchor, but a critical bug was encountered, resulting in the system crashing with a panic. I would appreciate it if you could take a look at this PR and see if it makes sense. Thank you.
Hi @diegomrsantos thanks for this! Appreciate the work. I'll take a look at this this week.