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

Unified Diff: src/list-inl.h

Issue 9104: Dispatch tables (Closed)
Patch Set: Created 12 years, 1 month 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
« src/jsregexp.cc ('K') | « src/list.h ('k') | src/parser.cc » ('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 a185af3197f937035ff760da30eea266e2f89bd2..28856d25cab2d16b737c982b0a74479d4172b046 100644
--- a/src/list-inl.h
+++ b/src/list-inl.h
@@ -90,6 +90,16 @@ void List<T, P>::Iterate(void (*callback)(T* x)) {
template<typename T, class P>
+bool List<T, P>::Contains(T& elm) {
+ for (int i = 0; i < length_; i++) {
+ if (data_[i] == elm)
+ return true;
+ }
+ return false;
+}
+
+
+template<typename T, class P>
void List<T, P>::Sort(int (*cmp)(const T* x, const T* y)) {
qsort(data_,
length_,
« src/jsregexp.cc ('K') | « src/list.h ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698