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

Unified Diff: src/vector.h

Issue 1204013003: Revert of Extend big-disjunction optimization to case-independent regexps (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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-inl.h ('k') | test/mjsunit/regexp-sort.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/vector.h
diff --git a/src/vector.h b/src/vector.h
index 4f3128b9185cd42d21e439913a967c79753cb6f5..d022fde3a5bb25d88b7fba5e9ca4ae375e94d20b 100644
--- a/src/vector.h
+++ b/src/vector.h
@@ -69,30 +69,24 @@
return Vector<T>(result, length_);
}
- template <typename CompareFunction>
- void Sort(CompareFunction cmp, size_t s, size_t l) {
- std::sort(start() + s, start() + s + l, RawComparer<CompareFunction>(cmp));
- }
-
- template <typename CompareFunction>
- void Sort(CompareFunction cmp) {
- std::sort(start(), start() + length(), RawComparer<CompareFunction>(cmp));
+ void Sort(int (*cmp)(const T*, const T*), size_t s, size_t l) {
+ std::sort(start() + s, start() + s + l, RawComparer(cmp));
+ }
+
+ void Sort(int (*cmp)(const T*, const T*)) {
+ std::sort(start(), start() + length(), RawComparer(cmp));
}
void Sort() {
std::sort(start(), start() + length());
}
- template <typename CompareFunction>
- void StableSort(CompareFunction cmp, size_t s, size_t l) {
- std::stable_sort(start() + s, start() + s + l,
- RawComparer<CompareFunction>(cmp));
- }
-
- template <typename CompareFunction>
- void StableSort(CompareFunction cmp) {
- std::stable_sort(start(), start() + length(),
- RawComparer<CompareFunction>(cmp));
+ void StableSort(int (*cmp)(const T*, const T*), size_t s, size_t l) {
+ std::stable_sort(start() + s, start() + s + l, RawComparer(cmp));
+ }
+
+ void StableSort(int (*cmp)(const T*, const T*)) {
+ std::stable_sort(start(), start() + length(), RawComparer(cmp));
}
void StableSort() { std::stable_sort(start(), start() + length()); }
@@ -142,16 +136,15 @@
T* start_;
int length_;
- template <typename CookedComparer>
class RawComparer {
public:
- explicit RawComparer(CookedComparer cmp) : cmp_(cmp) {}
+ explicit RawComparer(int (*cmp)(const T*, const T*)) : cmp_(cmp) {}
bool operator()(const T& a, const T& b) {
return cmp_(&a, &b) < 0;
}
private:
- CookedComparer cmp_;
+ int (*cmp_)(const T*, const T*);
};
};
« no previous file with comments | « src/list-inl.h ('k') | test/mjsunit/regexp-sort.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698