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

fix: use stableSort routine when sorting transports. Fixes #152, #141 #158

Merged
merged 5 commits into from
Nov 23, 2018

Conversation

tmorehouse
Copy link

@tmorehouse tmorehouse commented Nov 20, 2018

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

@LinusBorg
Copy link
Owner

Thanks, highly apprchiated.

But I think there might be something missing from your PR? You added the stableSort function to the utils, but don't import / use it anywhere?

Copy link
Owner

@LinusBorg LinusBorg left a comment

Choose a reason for hiding this comment

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

See comment above.

@tmorehouse
Copy link
Author

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

@tmorehouse
Copy link
Author

commit re-pushed to actually use stableSort

@tmorehouse
Copy link
Author

@LinusBorg should be all fixed up now

@LinusBorg
Copy link
Owner

Thanks, I'll check it out.

Copy link
Owner

@LinusBorg LinusBorg left a 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.

@LinusBorg LinusBorg merged commit cff3861 into LinusBorg:develop Nov 23, 2018
@tmorehouse tmorehouse deleted the patch-1 branch November 23, 2018 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants