Skip to content

Commit

Permalink
Merge pull request #31 from nburles/simpler-hash-calls
Browse files Browse the repository at this point in the history
There is no need to call ->hashCode() explicitly
  • Loading branch information
mike-lischke authored Aug 1, 2016
2 parents 8bbdbe0 + 64f1a65 commit 63b5e61
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion runtime/Cpp/runtime/src/atn/LexerATNConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ size_t LexerATNConfig::hashCode() const {
hashCode = misc::MurmurHash::update(hashCode, context);
hashCode = misc::MurmurHash::update(hashCode, semanticContext);
hashCode = misc::MurmurHash::update(hashCode, _passedThroughNonGreedyDecision ? 1 : 0);
hashCode = misc::MurmurHash::update(hashCode, _lexerActionExecutor ? _lexerActionExecutor->hashCode() : 0);
hashCode = misc::MurmurHash::update(hashCode, _lexerActionExecutor);
hashCode = misc::MurmurHash::finish(hashCode, 6);
return hashCode;
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/Cpp/runtime/src/atn/LexerActionExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ bool LexerActionExecutor::operator == (const LexerActionExecutor &obj) const {
size_t LexerActionExecutor::generateHashCode() const {
size_t hash = MurmurHash::initialize();
for (auto lexerAction : _lexerActions) {
hash = MurmurHash::update(hash, (size_t)lexerAction->hashCode());
hash = MurmurHash::update(hash, lexerAction);
}
MurmurHash::finish(hash, _lexerActions.size());

Expand Down
2 changes: 1 addition & 1 deletion runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void LexerIndexedCustomAction::execute(Lexer *lexer) {
size_t LexerIndexedCustomAction::hashCode() const {
size_t hash = MurmurHash::initialize();
hash = MurmurHash::update(hash, _offset);
hash = MurmurHash::update(hash, _action->hashCode());
hash = MurmurHash::update(hash, _action);
return MurmurHash::finish(hash, 2);
}

Expand Down

0 comments on commit 63b5e61

Please sign in to comment.