Change sort optional parameters from Handle to any and update SortFunc1D/2D typedef#1741
Change sort optional parameters from Handle to any and update SortFunc1D/2D typedef#1741JoinedSenses wants to merge 6 commits intoalliedmodders:masterfrom
Conversation
Not seeing any particular reason why the optional parameter needs to exclusively be a handle. This change shouldn't break any API.
Headline
left a comment
There was a problem hiding this comment.
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 |
asherkin
left a comment
There was a problem hiding this comment.
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? |
anyinstead ofint