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

Rework duplicate ordering logic, add feature type preference #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

parkan
Copy link
Contributor

@parkan parkan commented Jun 19, 2015

My attempt to refactor the dupe sorting logic has led me to discover some very dumb choices made in the design of scala.math.Ordering

It's also impossible to test any of this because everything is defined inside a method. TODO: factor out orderings into a trait etc, do not merge until then.

-1 * comparators
.map(_.compare(a,b))
.find(_ !=? 0) // find first non-tie
.getOrElse(b._2.compare(a._2)) // if all ties, just sort on original order
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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