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

Unified Diff: runtime/vm/growable_array.h

Issue 10909094: Implement loop invariant code motion for check instructions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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: runtime/vm/growable_array.h
===================================================================
--- runtime/vm/growable_array.h (revision 11934)
+++ runtime/vm/growable_array.h (working copy)
@@ -89,6 +89,15 @@
data_[idx] = value;
}
+ bool Contains(const T& value) {
Kevin Millikin (Google) 2012/09/06 12:42:42 I actually like not having this function defined :
Florian Schneider 2012/09/06 13:05:53 Done.
+ for (intptr_t i = 0; i < length(); i++) {
+ if (data_[i] == value) {
+ return true;
+ }
+ }
+ return false;
+ }
+
// Sort the array in place.
inline void Sort(int compare(const T*, const T*));

Powered by Google App Engine
This is Rietveld 408576698