-
-
Notifications
You must be signed in to change notification settings - Fork 429
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
Change sort optional parameters from Handle to any and update SortFunc1D/2D typedef #1741
base: master
Are you sure you want to change the base?
Conversation
Not seeing any particular reason why the optional parameter needs to exclusively be a handle. This change shouldn't break any API.
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.
Other than that one doc comment, this seems fine to me!
Go ahead and switch that out and I'll pull this in
any and floats aren't friends, since the float operators aren't used if a float is tagged as Can you add a warning for float arrays? |
This seems like a general sp nuisance not specific to sort stuff that folks should be aware of in general, so I feel like this isn't the best place to put that info, though I don't mind adding a note I suppose. |
If they're retagged in the function prototype for comparison the correct operator will be used, no? iirc you can pass in a float[] as any[], and in the comparison accept float type and not any |
yep, that is also true |
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.
LGTM
The SortCustom2D
/ SortFunc2D
change is interesting because I'm pretty sure this used to work correctly (as long as the callback matched) before passing char[]
to any[]
was prevented. With that change and now this actually removing the unusable prototype I think we've lost the ability to sort arrays of strings.
My pull request at #1124 is very identical to this apart from mine having optional data param in callbacks. |
@asherkin are you still OK with this? |
any
instead ofint