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

fix(N-04) Avoid unnecessary swap operation #321

Merged
merged 3 commits into from
Oct 9, 2024
Merged

Conversation

ggonzalez94
Copy link
Collaborator

Resolves #317

@bidzyyys bidzyyys linked an issue Oct 4, 2024 that may be closed by this pull request
1 task
}

hash_pair(&a, &b, state)
hash_pair(a, b, state)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: I would refactor to:

if a > b {
  hash_pair(b, a, state)
}
else {
  hash_pair(a, b, state)
}

Copy link
Collaborator

@bidzyyys bidzyyys Oct 4, 2024

Choose a reason for hiding this comment

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

To make it more readable

Copy link
Member

Choose a reason for hiding this comment

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

yeah, more "rusty"

Copy link
Collaborator

@bidzyyys bidzyyys left a comment

Choose a reason for hiding this comment

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

Left small comment.

Copy link
Member

@qalisander qalisander left a comment

Choose a reason for hiding this comment

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

LGTM!

}

hash_pair(&a, &b, state)
hash_pair(a, b, state)
Copy link
Member

Choose a reason for hiding this comment

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

yeah, more "rusty"

@bidzyyys bidzyyys self-requested a review October 4, 2024 17:55
Copy link
Collaborator

@bidzyyys bidzyyys left a comment

Choose a reason for hiding this comment

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

LGTM!

@ggonzalez94 ggonzalez94 changed the title Avoid unnecessary swap operation fix(N-04) Avoid unnecessary swap operation Oct 4, 2024
@ggonzalez94 ggonzalez94 merged commit 7c84e68 into v0.1.0 Oct 9, 2024
19 checks passed
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.

[Audit]: N-04 Unnecessary Swap Operation
3 participants