aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-04-01 11:21:27 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-04-01 11:21:27 -0700
commitfb8307c6b78bfbaa5e969a9df0c007c232d6251d (patch)
tree47400bafcc39e94f512810bb4b0011db228475a0 /src/core
parent1865900525b6c6df19824813c0d3222ad6a90da2 (diff)
Add SkTHashSet::find()
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkTHash.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/SkTHash.h b/src/core/SkTHash.h
index 967b9be878..c4bd3b6161 100644
--- a/src/core/SkTHash.h
+++ b/src/core/SkTHash.h
@@ -231,7 +231,11 @@ public:
void add(const T& item) { fTable.set(item); }
// Is this item in the set?
- bool contains(const T& item) const { return SkToBool(fTable.find(item)); }
+ bool contains(const T& item) const { return SkToBool(this->find(item)); }
+
+ // If an item equal to this is in the set, return a pointer to it, otherwise null.
+ // This pointer remains valid until the next call to add().
+ const T* find(const T& item) const { return fTable.find(item); }
private:
struct Traits {