From 64f1a654bd903ba8d0f2de50b1b3e125c56fe2f1 Mon Sep 17 00:00:00 2001 From: Nathan Burles Date: Mon, 1 Aug 2016 16:40:15 +0100 Subject: [PATCH] There is no need to call ->hashCode() explicitly --- runtime/Cpp/runtime/src/atn/LexerATNConfig.cpp | 2 +- runtime/Cpp/runtime/src/atn/LexerActionExecutor.cpp | 2 +- runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/Cpp/runtime/src/atn/LexerATNConfig.cpp b/runtime/Cpp/runtime/src/atn/LexerATNConfig.cpp index df6c26550..ca164fc81 100755 --- a/runtime/Cpp/runtime/src/atn/LexerATNConfig.cpp +++ b/runtime/Cpp/runtime/src/atn/LexerATNConfig.cpp @@ -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; } diff --git a/runtime/Cpp/runtime/src/atn/LexerActionExecutor.cpp b/runtime/Cpp/runtime/src/atn/LexerActionExecutor.cpp index 91198b074..7603bf953 100755 --- a/runtime/Cpp/runtime/src/atn/LexerActionExecutor.cpp +++ b/runtime/Cpp/runtime/src/atn/LexerActionExecutor.cpp @@ -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()); diff --git a/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.cpp b/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.cpp index a6110197f..e01bd8801 100755 --- a/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.cpp +++ b/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.cpp @@ -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); }