Skip to content
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

Implement {PartialOrd, Ord, Hash} for DiversifierIndex #16

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

nuttycom
Copy link
Contributor

No description provided.

.iter()
.rev()
.zip(other.0.iter().rev())
.find_map(|(a, b)| match a.cmp(b) {
Copy link

@daira daira Sep 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't a [u8] already have an ordering? I.e. it should be possible to compare the reversed arrays directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This uses the reversed iterators, and so doesn't require allocation of a Vec in order to compare the slices.

Copy link

@daira daira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK with comment about a potential simplification.

@nuttycom nuttycom merged commit ea6a62c into master Sep 11, 2024
21 checks passed
@nuttycom nuttycom deleted the diversifier_index_ord branch September 11, 2024 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants