From 4977cd98ea4a3f8f491c18ae84fe6f051482bd12 Mon Sep 17 00:00:00 2001 From: Andreas Buhr Date: Wed, 10 Apr 2024 18:24:50 +0200 Subject: [PATCH] Improve implementation of ParserATNSimulator::getConflictingAlts() PredictionModeClass::getAlts(configs) yields the same result as PredictionModeClass::getAlts( PredictionModeClass::getConflictingAltSubsets(configs) ) Both return a BitSet with bits set for all alts which occur in configs. Signed-off-by: Andreas Buhr --- runtime/Cpp/runtime/src/atn/ParserATNSimulator.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/runtime/Cpp/runtime/src/atn/ParserATNSimulator.cpp b/runtime/Cpp/runtime/src/atn/ParserATNSimulator.cpp index 3a1537587c..2817c30323 100755 --- a/runtime/Cpp/runtime/src/atn/ParserATNSimulator.cpp +++ b/runtime/Cpp/runtime/src/atn/ParserATNSimulator.cpp @@ -1201,8 +1201,7 @@ Ref ParserATNSimulator::ruleTransition(Ref const& config, } BitSet ParserATNSimulator::getConflictingAlts(ATNConfigSet *configs) { - std::vector altsets = PredictionModeClass::getConflictingAltSubsets(configs); - return PredictionModeClass::getAlts(altsets); + return PredictionModeClass::getAlts(configs); } BitSet ParserATNSimulator::getConflictingAltsOrUniqueAlt(ATNConfigSet *configs) {