Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(493)

Unified Diff: src/list-inl.h

Issue 1204123003: Reland Extend big-disjunction optimization to case-independent regexps (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Skip slow architecture-independent tests on slower CPUs and simulators Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/list.h ('k') | src/vector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/list-inl.h
diff --git a/src/list-inl.h b/src/list-inl.h
index c09788e9ae0e466e5639673c909215b4e52e8d8f..98f0343fa57f0b84aff9254bf6c1bed7b482e56a 100644
--- a/src/list-inl.h
+++ b/src/list-inl.h
@@ -193,14 +193,16 @@ int List<T, P>::CountOccurrences(const T& elm, int start, int end) const {
}
-template<typename T, class P>
-void List<T, P>::Sort(int (*cmp)(const T* x, const T* y)) {
+template <typename T, class P>
+template <typename CompareFunction>
+void List<T, P>::Sort(CompareFunction cmp) {
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) {
+template <typename CompareFunction>
+void List<T, P>::Sort(CompareFunction cmp, size_t s, size_t l) {
ToVector().Sort(cmp, s, l);
#ifdef DEBUG
for (size_t i = s + 1; i < l; i++) DCHECK(cmp(&data_[i - 1], &data_[i]) <= 0);
@@ -215,14 +217,15 @@ void List<T, P>::Sort() {
template <typename T, class P>
-void List<T, P>::StableSort(int (*cmp)(const T* x, const T* y)) {
+template <typename CompareFunction>
+void List<T, P>::StableSort(CompareFunction cmp) {
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) {
+template <typename CompareFunction>
+void List<T, P>::StableSort(CompareFunction cmp, 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);
« no previous file with comments | « src/list.h ('k') | src/vector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698