-
Notifications
You must be signed in to change notification settings - Fork 83
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
SimpleQuery._createSortQuerier sort comparator function is incorrect #159
Labels
Comments
SimpleQuery._createSortQuerier
sort comparator function is incorrect
msssk
added a commit
to msssk/dstore
that referenced
this issue
Apr 9, 2020
msssk
added a commit
that referenced
this issue
Apr 9, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/SitePen/dstore/blob/v1.1.0/SimpleQuery.js#L172
If
sorted
is an empty array line 196 will always return 0, indicating that both items were equal, which may not be the case. And is actually not the case in Chrome, becauseArray#sort
does not iterate over items in order. For arrays larger than a certain size (10?) it appears to use a half-interval algorithm, so data that was originally in a certain order will be changed to a different order with dstore's current logic.The text was updated successfully, but these errors were encountered: