2017-11-07 14:45 GMT+01:00 Denis Kudriashov <[hidden email]>:2017-11-07 14:40 GMT+01:00 Nicolas Cellier <[hidden email]>:2017-11-07 14:20 GMT+01:00 Denis Kudriashov <[hidden email]>:I have new question. Why we really need threeWayCompareTo:?DefaultSortFunction can implement it using standard comparison methods.But what would the DefaultSortFunction use?2 among the 3 selectors < = > ?It's just that we might scan String twice when <=> would do it once, but apart that is OKYes, you are right.And we already have VM based String compare: with strange logic returning 1, 2, 3. So we already can optimize current String>>threeWayCompareTo:.Maybe good idea to open ticket and modify image level methods to return standard -1,0,1 values.
2017-11-07 14:40 GMT+01:00 Nicolas Cellier <[hidden email]>:2017-11-07 14:20 GMT+01:00 Denis Kudriashov <[hidden email]>:I have new question. Why we really need threeWayCompareTo:?DefaultSortFunction can implement it using standard comparison methods.But what would the DefaultSortFunction use?2 among the 3 selectors < = > ?It's just that we might scan String twice when <=> would do it once, but apart that is OKYes, you are right.And we already have VM based String compare: with strange logic returning 1, 2, 3. So we already can optimize current String>>threeWayCompareTo:.
2017-11-07 14:20 GMT+01:00 Denis Kudriashov <[hidden email]>:I have new question. Why we really need threeWayCompareTo:?DefaultSortFunction can implement it using standard comparison methods.But what would the DefaultSortFunction use?2 among the 3 selectors < = > ?It's just that we might scan String twice when <=> would do it once, but apart that is OK
I have new question. Why we really need threeWayCompareTo:?DefaultSortFunction can implement it using standard comparison methods.