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

Unified Diff: src/platform/update_engine/utils.h

Issue 578009: AU: Some graph types and a couple utility functions (Closed)
Patch Set: Created 10 years, 11 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/platform/update_engine/utils.h
diff --git a/src/platform/update_engine/utils.h b/src/platform/update_engine/utils.h
index de998f414ba93410a70c4b8ffcfcd7bb56c3f971..64810c2c2f9b0a35633424405a20fb28e5afa900 100644
--- a/src/platform/update_engine/utils.h
+++ b/src/platform/update_engine/utils.h
@@ -80,6 +80,16 @@ std::set<ValueType> SetWithValue(const ValueType& value) {
return ret;
}
+template<typename T>
+bool VectorContainsValue(const T& value, const std::vector<T>& vect) {
Daniel Erat 2010/02/05 17:55:19 this is easier (from <algorithm>): return std::fi
adlr 2010/02/22 23:27:31 Done.
+ for (typename std::vector<T>::const_iterator it = vect.begin();
+ it != vect.end(); ++it) {
+ if (*it == value)
+ return true;
+ }
+ return false;
+}
+
// Returns the currently booted device. "/dev/sda1", for example.
// This will not interpret LABEL= or UUID=. You'll need to use findfs
// or something with equivalent funcionality to interpret those.

Powered by Google App Engine
This is Rietveld 408576698