-
Notifications
You must be signed in to change notification settings - Fork 150
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
Altered json to be more regular #8
Conversation
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
No way to have two instances of Ss58AddressFormat that mean the same thing but are different. (Before Custom(42) was the same as Ss58AddressFormat::Substrate but not eq.)
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
(brought in from master merge on substrate PR)
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
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.
Just some tests would be nice.
Modulo the nitpicks. |
build.rs
Outdated
let mut registry = registry.registry; | ||
|
||
let mut ordered_prefixes = registry.iter().map(|i| i.prefix).collect::<Vec<_>>(); | ||
ordered_prefixes.sort_unstable(); |
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.
Don't use sort_unstable
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.
It's sorting primitives - there's no difference between 6 and 6 in this case - it's just a tad faster. In general I agree we don't want non-determinism but here I believe it makes no difference which we use.
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.
Please use sort()
.
it's just a tad faster.
We are sorting here like in maximum 256 elements, no one will be able to tell the difference.
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Less exceptions:
(See also paritytech/substrate#9755 )