You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[sui-framework] Added swap and swap_remove function to the table_vec.move (#13644)
## Description
Added `swap_remove` function to `table_vec.move` since we have a
situation to remove an certain element in the `TableVec` and both
`table` and `vector` have similar functionality implemented.
## Test Plan
New unit tests for `sui::table_vec`.
---
If your changes are not user-facing and not a breaking change, you can
skip the following section. Otherwise, please indicate what changed, and
then add to the Release Notes section as highlighted during the release
process.
### Type of Change (Check all that apply)
- [x] protocol change
- [x] user-visible impact
- [ ] breaking change for a client SDKs
- [x] breaking change for FNs (FN binary must upgrade)
- [x] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration
### Release notes
Introduces protocol version 25 which adds `sui::table_vec::swap` and
`sui::table_vec::swap_remove` to system packages. Use these functions to
swap two positions in a single `TableVec<T>` or swap an element to the
end and remove it in `O(1)` time, analogous to `std::vector::swap` and
`std::vector::swap_remove`.
---------
Co-authored-by: Ashok Menon <[email protected]>
0 commit comments