aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-10-15 12:23:01 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-10-15 12:23:02 -0700
commitc8d1dd48c01f562cfffe64da0e5cee5ed2713541 (patch)
treed561462e44e5b2f644b41c1fd670c1e66c5f03de /dm
parentb9519f86bbce946e505980a4fa950fdc4bcf74ab (diff)
SkTHash: hash from fnptr to functor type
Passing &SkGoodHash to SkTHashMap and SkTHashSet doesn't guarantee that it's actually instantiated. Using a functor does. BUG=skia: Review URL: https://codereview.chromium.org/1405053002
Diffstat (limited to 'dm')
-rw-r--r--dm/DM.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 4b32d2fc1a..ccff84c906 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -144,7 +144,11 @@ struct Gold : public SkString {
this->append(name);
this->append(md5);
}
- static uint32_t Hash(const Gold& g) { return SkGoodHash((const SkString&)g); }
+ struct Hash {
+ uint32_t operator()(const Gold& g) const {
+ return SkGoodHash()((const SkString&)g);
+ }
+ };
};
static SkTHashSet<Gold, Gold::Hash> gGold;