| Index: src/list-inl.h
|
| diff --git a/src/list-inl.h b/src/list-inl.h
|
| index c09788e9ae0e466e5639673c909215b4e52e8d8f..9b122fdbae4417fc710b755cc4be9fe541f4b04b 100644
|
| --- a/src/list-inl.h
|
| +++ b/src/list-inl.h
|
| @@ -195,15 +195,10 @@
|
|
|
| template<typename T, class P>
|
| void List<T, P>::Sort(int (*cmp)(const T* x, const T* y)) {
|
| - Sort(cmp, 0, length_);
|
| -}
|
| -
|
| -
|
| -template <typename T, class P>
|
| -void List<T, P>::Sort(int (*cmp)(const T* x, const T* y), size_t s, size_t l) {
|
| - ToVector().Sort(cmp, s, l);
|
| + ToVector().Sort(cmp);
|
| #ifdef DEBUG
|
| - for (size_t i = s + 1; i < l; i++) DCHECK(cmp(&data_[i - 1], &data_[i]) <= 0);
|
| + for (int i = 1; i < length_; i++)
|
| + DCHECK(cmp(&data_[i - 1], &data_[i]) <= 0);
|
| #endif
|
| }
|
|
|
| @@ -214,29 +209,7 @@
|
| }
|
|
|
|
|
| -template <typename T, class P>
|
| -void List<T, P>::StableSort(int (*cmp)(const T* x, const T* y)) {
|
| - StableSort(cmp, 0, length_);
|
| -}
|
| -
|
| -
|
| -template <typename T, class P>
|
| -void List<T, P>::StableSort(int (*cmp)(const T* x, const T* y), size_t s,
|
| - size_t l) {
|
| - ToVector().StableSort(cmp, s, l);
|
| -#ifdef DEBUG
|
| - for (size_t i = s + 1; i < l; i++) DCHECK(cmp(&data_[i - 1], &data_[i]) <= 0);
|
| -#endif
|
| -}
|
| -
|
| -
|
| -template <typename T, class P>
|
| -void List<T, P>::StableSort() {
|
| - ToVector().StableSort();
|
| -}
|
| -
|
| -
|
| -template <typename T, class P>
|
| +template<typename T, class P>
|
| void List<T, P>::Initialize(int capacity, P allocator) {
|
| DCHECK(capacity >= 0);
|
| data_ = (capacity > 0) ? NewData(capacity, allocator) : NULL;
|
|
|