forked from jasder/antlr
Merge pull request #31 from nburles/simpler-hash-calls
There is no need to call ->hashCode() explicitly
This commit is contained in:
commit
63b5e61c15
|
@ -82,7 +82,7 @@ size_t LexerATNConfig::hashCode() const {
|
||||||
hashCode = misc::MurmurHash::update(hashCode, context);
|
hashCode = misc::MurmurHash::update(hashCode, context);
|
||||||
hashCode = misc::MurmurHash::update(hashCode, semanticContext);
|
hashCode = misc::MurmurHash::update(hashCode, semanticContext);
|
||||||
hashCode = misc::MurmurHash::update(hashCode, _passedThroughNonGreedyDecision ? 1 : 0);
|
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);
|
hashCode = misc::MurmurHash::finish(hashCode, 6);
|
||||||
return hashCode;
|
return hashCode;
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,7 +118,7 @@ bool LexerActionExecutor::operator == (const LexerActionExecutor &obj) const {
|
||||||
size_t LexerActionExecutor::generateHashCode() const {
|
size_t LexerActionExecutor::generateHashCode() const {
|
||||||
size_t hash = MurmurHash::initialize();
|
size_t hash = MurmurHash::initialize();
|
||||||
for (auto lexerAction : _lexerActions) {
|
for (auto lexerAction : _lexerActions) {
|
||||||
hash = MurmurHash::update(hash, (size_t)lexerAction->hashCode());
|
hash = MurmurHash::update(hash, lexerAction);
|
||||||
}
|
}
|
||||||
MurmurHash::finish(hash, _lexerActions.size());
|
MurmurHash::finish(hash, _lexerActions.size());
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ void LexerIndexedCustomAction::execute(Lexer *lexer) {
|
||||||
size_t LexerIndexedCustomAction::hashCode() const {
|
size_t LexerIndexedCustomAction::hashCode() const {
|
||||||
size_t hash = MurmurHash::initialize();
|
size_t hash = MurmurHash::initialize();
|
||||||
hash = MurmurHash::update(hash, _offset);
|
hash = MurmurHash::update(hash, _offset);
|
||||||
hash = MurmurHash::update(hash, _action->hashCode());
|
hash = MurmurHash::update(hash, _action);
|
||||||
return MurmurHash::finish(hash, 2);
|
return MurmurHash::finish(hash, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue