aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/core/SkTDArray.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/core/SkTDArray.h b/include/core/SkTDArray.h
index 1afd3d08a9..60c987d933 100644
--- a/include/core/SkTDArray.h
+++ b/include/core/SkTDArray.h
@@ -229,6 +229,13 @@ public:
}
/**
+ * Returns true iff the array contains this element.
+ */
+ bool contains(const T& elem) const {
+ return (this->find(elem) >= 0);
+ }
+
+ /**
* Copies up to max elements into dst. The number of items copied is
* capped by count - index. The actual number copied is returned.
*/
@@ -333,4 +340,3 @@ private:
};
#endif
-