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

Tag sort is undefined for equal occurrences #1142

Closed
ArthurHoaro opened this issue May 19, 2018 · 0 comments
Closed

Tag sort is undefined for equal occurrences #1142

ArthurHoaro opened this issue May 19, 2018 · 0 comments
Assignees
Labels
Milestone

Comments

@ArthurHoaro
Copy link
Member

Currently, linksCountPerTag() returns a list of tags sorted by their number of occurrences across links.

They're sorted using arsort(), which doesn't define the sort behaviour for equal values. This function doesn't produce the same result between PHP 5.6 and 7, hence the tests failure in #1141.

Note:
If two members compare as equal, their relative order in the sorted array is undefined.

Also this comment.

I suggest that we fix that by manually sorting equal tags by alphabetical order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant