mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Bug 1839506 - Part 1: Add a parameterless overload for StableSort r=emilio
This follows the existing examples of Sort, Contains, etc. Differential Revision: https://phabricator.services.mozilla.com/D182735
This commit is contained in:
parent
a963836ce1
commit
08e5b250d0
@ -653,7 +653,7 @@ struct ColorLineT {
|
||||
*aFirstStop = *aLastStop = aStops[0].offset;
|
||||
return;
|
||||
}
|
||||
aStops.StableSort(nsDefaultComparator<GradientStop, GradientStop>());
|
||||
aStops.StableSort();
|
||||
if (aReverse) {
|
||||
float a = aStops[0].offset;
|
||||
float b = aStops.LastElement().offset;
|
||||
|
@ -2397,6 +2397,12 @@ class nsTArray_Impl
|
||||
});
|
||||
}
|
||||
|
||||
// A variation on the StableSort method defined above that assumes that
|
||||
// 'operator<' is defined for value_type.
|
||||
void StableSort() {
|
||||
StableSort(nsDefaultComparator<value_type, value_type>());
|
||||
}
|
||||
|
||||
// This method reverses the array in place.
|
||||
void Reverse() {
|
||||
value_type* elements = Elements();
|
||||
|
Loading…
Reference in New Issue
Block a user