Skip to content

Conversation

@Ahmad-Alsaleh
Copy link

This commit has three changes:

  1. use total_cmp instead of partial_cmp to compare floats. Unlike patial_cmp, total_cmp doesn't return an error.
  2. replace Vec::sort_by() with Vec::sort_unstable_by() to increase sorting speed.
  3. avoid calling Vec::reverse() after sorting by comparing rank2 to rank1 instead of rank1 to rank2.

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.

1 participant