Skip to content

Commit

Permalink
Hot fix for hashing algorithm.
Browse files Browse the repository at this point in the history
  • Loading branch information
Organic-Code committed May 26, 2017
1 parent 2858fef commit 23e611c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/breep/util/type_traits.hpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ namespace breep {
uint64_t hash(const std::string& str) {
uint64_t hash_code = 0;

for (auto c : str) {
if (c != '>' && c != '<' && c != ',' && c != ':') {
hash_code = c + (hash_code << 6) + (hash_code << 16) - hash_code;
for (unsigned int i = str.size() ; i-- ;) {
if (str[i] != '>' && str[i] != ',' && str[i] != ' ' && (str[i] != ':' || str[i+1] != ':')) {
hash_code = str[i] + (hash_code << 6) + (hash_code << 16) - hash_code;
}
}
return hash_code;
Expand Down

0 comments on commit 23e611c

Please sign in to comment.