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

Unified Diff: src/core/SkTSort.h

Issue 12316141: Sort GL extension strings and search to find. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 10 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
Index: src/core/SkTSort.h
===================================================================
--- src/core/SkTSort.h (revision 7872)
+++ src/core/SkTSort.h (working copy)
@@ -205,4 +205,14 @@
SkTQSort(left, right, SkTPointerCompareLT<T>());
}
+/** Adapts an SkTSearch comparison function to a SkTSort functor */
reed1 2013/02/26 23:05:44 Why is the functor called COMPARE instead of LT or
bsalomon 2013/02/27 16:56:36 Done, and made the comment a bit more explicit abo
+template <typename T, int (COMPARE)(const T*, const T*)>
+class SkTSearchCompareFunctor {
+public:
+ bool operator()(const T& a, const T& b) {
+ return COMPARE(&a, &b) < 0;
+ }
+};
+
+
#endif

Powered by Google App Engine
This is Rietveld 408576698