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. |