Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4649)

Unified Diff: cc/quads/render_pass.h

Issue 21648002: Extract pair hash functions so that they can be re-used outside of hash tables (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix RenderPass::ID hash Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/containers/hash_tables.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/quads/render_pass.h
diff --git a/cc/quads/render_pass.h b/cc/quads/render_pass.h
index da1bc9a0966f26bebf2e326fc3d17a477f7e1833..3d5a37cb78d9c1e4fbf1ee6c8785ae71e0e64b13 100644
--- a/cc/quads/render_pass.h
+++ b/cc/quads/render_pass.h
@@ -117,17 +117,14 @@ class CC_EXPORT RenderPass {
namespace BASE_HASH_NAMESPACE {
#if defined(COMPILER_MSVC)
-template<>
-inline size_t hash_value<cc::RenderPass::Id>(const cc::RenderPass::Id& key) {
- return hash_value<std::pair<int, int> >(
- std::pair<int, int>(key.layer_id, key.index));
+inline size_t hash_value(const cc::RenderPass::Id& key) {
+ return base::HashPair(key.layer_id, key.index);
}
#elif defined(COMPILER_GCC)
template<>
struct hash<cc::RenderPass::Id> {
size_t operator()(cc::RenderPass::Id key) const {
- return hash<std::pair<int, int> >()(
- std::pair<int, int>(key.layer_id, key.index));
+ return base::HashPair(key.layer_id, key.index);
}
};
#else
« no previous file with comments | « base/containers/hash_tables.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698