-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: implement keys
and values
on StableBTreeMap
#241
Conversation
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.
I feel like it would be a good idea to introduce some benchmarks that cover the new functions added as well, wdyt?
Done! |
|
This adds
keys
andvalues
toStableBTreeMap
bringing it more in line with the stdBTreeMap
.It also adds
keys_range
andvalues_range
which aren't exposed by the stdBTreeMap
, with the std map these aren't really needed because the keys and values are returned by reference, so it is still efficient to userange
and thenmap
to get the keys or the values.But with the
StableBTreeMap
using the same approach would result in reading and deserializing the keys and values, only to throw one set of them away.