-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add feature to support mutation for array and map iterators #359
Add feature to support mutation for array and map iterators #359
Conversation
Mutable iterator for array and map supports: - indirect element mutation, such as modifying nested container - direct element mutation, such as overwriting existing element with new element Mutable iterator for array and map doesn't support: - inserting new elements into the array/map - removing existing elements from the array/map NOTE: use readonly iterator if mutation is not needed for better performance. This commit: - adds new interfaces ArrayIterator and MapIterator - decouples implementation of mutable and readonly iterators - refactors related functions
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## feature/array-map-inlining #359 +/- ##
==============================================================
- Coverage 62.52% 62.45% -0.07%
==============================================================
Files 15 15
Lines 10599 10919 +320
==============================================================
+ Hits 6627 6820 +193
- Misses 3021 3119 +98
- Partials 951 980 +29 ☔ View full report in Codecov by Sentry. |
While at it, also reduce matrix of OS and Go versions given the duration of tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
@fxamacker Do we still need this for onflow/cadence#2882? |
@turbolent Yes, we need this for integration PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I mainly reviewed it from a Go perspective, as in general, I lack a bit of understanding of the inner working of Atree to fully review if the changes are correct or if there is something missing
Closes #356 #357
Updates #292 onflow/flow-go#4633
Add support for mutable iterators, including support for atree splitting/merging during iteration from inlining, uninlining, and mutated values).
This feature was discussed on Discord:
Mutable iterator for array and map supports:
Mutable iterator for array and map doesn't support:
NOTE: for better performance, use readonly iterator if mutation is not needed.
This PR:
main
branchFiles changed
in the Github PR explorer