|
The method can be made more efficient by not doing two comparisons and instead using a the built in comparison method:
<code>
"protocol: *SortFunctions-Core-comparing"
threeWayCompareTo: aString
"Do a three-way comparison between the receiver and aString, returning
-1 if self < aString
0 if self = aString
1 if self > aString
This assumes a total order in accordance with the mathematical law of trichotomy.
See also: http://en.wikipedia.org/wiki/Three-way_comparison"
^ (self compare: self with: aString collated: AsciiOrder) - 2
</code>
|
|
|
Priority: 5 – Fix If Time
|
|
Status: Work Needed
|
|
Assigned to: Everyone
|
|
Milestone: Pharo7.0
|
Go to Case
|
|