-
-
Notifications
You must be signed in to change notification settings - Fork 187
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: use stableSort routine when sorting transports. Fixes #152, #141 #158
Conversation
Thanks, highly apprchiated. But I think there might be something missing from your PR? You added the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment above.
Weird, I had made a second edit to wormhole.js to use stable sort, but looks like it didn't make it in on the PR.. I'll update |
commit re-pushed to actually use stableSort |
@LinusBorg should be all fixed up now |
Thanks, I'll check it out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks fine now.
Uses stable sort routine rather than native
Array.prototype.sort
to ensure a consistent sort across browser platforms and array sizes... (I'm looking at you Chrome 👿 )Stable Sort preserves original array order when elements end up with a compare result of
0
, by comparing by the original position (index) in the original array.Fixes #152, and most likely #141