diff options
author | 2015-04-01 11:21:27 -0700 | |
---|---|---|
committer | 2015-04-01 11:21:27 -0700 | |
commit | fb8307c6b78bfbaa5e969a9df0c007c232d6251d (patch) | |
tree | 47400bafcc39e94f512810bb4b0011db228475a0 /src/core | |
parent | 1865900525b6c6df19824813c0d3222ad6a90da2 (diff) |
Add SkTHashSet::find()
BUG=skia:
Review URL: https://codereview.chromium.org/1058553002
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkTHash.h | 6 |
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 { |