rule_based_prefetcher: actually implement hashing

This file is apparently not part of the image so I don't know how to
test these changes.
This commit is contained in:
Adrien Destugues
2015-01-10 10:48:43 +01:00
parent 740112693b
commit 42eb787c74
@@ -148,18 +148,19 @@ class RuleMatcher {
team_rules *fRules; team_rules *fRules;
}; };
struct RuleHash { struct RuleHash {
typedef char* KeyType; typedef char* KeyType;
typedef rules ValueType; typedef rules ValueType;
size_t HashKey(KeyType key) const size_t HashKey(KeyType key) const
{ {
return key >> 1; return hash_hash_string(key);
} }
size_t Hash(ValueType* value) const size_t Hash(ValueType* value) const
{ {
return HashKey(value->bar); return HashKey(value->name);
} }
bool Compare(KeyType key, ValueType* rules) const bool Compare(KeyType key, ValueType* rules) const
@@ -173,6 +174,7 @@ struct RuleHash {
} }
}; };
struct TeamHash { struct TeamHash {
typedef team_id KeyType; typedef team_id KeyType;
typedef team_rules ValueType; typedef team_rules ValueType;