diff options
author | mtklein <mtklein@chromium.org> | 2015-10-15 12:23:01 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-15 12:23:02 -0700 |
commit | c8d1dd48c01f562cfffe64da0e5cee5ed2713541 (patch) | |
tree | d561462e44e5b2f644b41c1fd670c1e66c5f03de /dm | |
parent | b9519f86bbce946e505980a4fa950fdc4bcf74ab (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.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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; |