-
Notifications
You must be signed in to change notification settings - Fork 41
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
Use CountedStorageMap instead of StorageMap for Jurors in court pallet #707
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.
According to this the CountedStorageMap
allows to count()
without going throughout the full iterator. This is a performance optimisation. There speaks nothing against this change to me. Cool @vivekvpandya !
Actually it must be using a small variable (storage) to track the count. But I think it should be fine given runtime benefit. |
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.
Yeah, looks good to me!
Before merging, please verify if a storage migration is required. The count probably is initialized at 0, although there already might be storage elements present. |
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.
Thanks for the changes! Looks good to me. 👍
Fixes https://github.com/zeitgeistpm/runtime-audit-1/issues/3