| Index: src/list-inl.h
|
| diff --git a/src/list-inl.h b/src/list-inl.h
|
| index eeb580323f36700fc812997dd455032f6fcb5c08..80094fbdca863a7d67b1da3acd42079f7605e5f9 100644
|
| --- a/src/list-inl.h
|
| +++ b/src/list-inl.h
|
| @@ -101,10 +101,7 @@ bool List<T, P>::Contains(const T& elm) {
|
|
|
| template<typename T, class P>
|
| void List<T, P>::Sort(int (*cmp)(const T* x, const T* y)) {
|
| - qsort(data_,
|
| - length_,
|
| - sizeof(T),
|
| - reinterpret_cast<int (*)(const void*, const void*)>(cmp));
|
| + ToVector().Sort(cmp);
|
| #ifdef DEBUG
|
| for (int i = 1; i < length_; i++)
|
| ASSERT(cmp(&data_[i - 1], &data_[i]) <= 0);
|
| @@ -113,6 +110,12 @@ void List<T, P>::Sort(int (*cmp)(const T* x, const T* y)) {
|
|
|
|
|
| template<typename T, class P>
|
| +void List<T, P>::Sort() {
|
| + Sort(PointerSpaceship<T>);
|
| +}
|
| +
|
| +
|
| +template<typename T, class P>
|
| void List<T, P>::Initialize(int capacity) {
|
| ASSERT(capacity >= 0);
|
| data_ = (capacity > 0) ? NewData(capacity) : NULL;
|
|
|