Commit a65c6f23 authored by Mattijs Janssens's avatar Mattijs Janssens
Browse files

make SortableList::sort always use stable sort

parent 7fa60e67
......@@ -86,28 +86,7 @@ void Foam::SortableList<Type>::sort()
indices_[i] = i;
}
Foam::sort(indices_, less(*this));
List<Type> tmpValues(this->size());
forAll(indices_, i)
{
tmpValues[i] = this->operator[](indices_[i]);
}
List<Type>::transfer(tmpValues);
}
template <class Type>
void Foam::SortableList<Type>::stableSort()
{
forAll(indices_, i)
{
indices_[i] = i;
}
//Foam::sort(indices_, less(*this));
Foam::stableSort(indices_, less(*this));
List<Type> tmpValues(this->size());
......
......@@ -109,12 +109,9 @@ public:
//- Size the list. If grow can cause undefined indices (until next sort)
void setSize(const label);
//- Sort the list (if changed after construction time)
//- (stable) sort the list (if changed after construction time)
void sort();
//- Sort the list (if changed after construction time)
void stableSort();
// Member Operators
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment