more tuning

This commit is contained in:
Eric Vergnaud 2015-08-26 23:40:14 +08:00
parent 3a10724919
commit 980072b6b4
2 changed files with 6 additions and 6 deletions

View File

@ -498,11 +498,11 @@ class PredictionMode(object):
def getConflictingAltSubsets(cls, configs):
configToAlts = dict()
for c in configs:
s = str(c.state.stateNumber) + "/" + str(c.context)
alts = configToAlts.get(s, None)
h = hash((c.state.stateNumber, c.context))
alts = configToAlts.get(h, None)
if alts is None:
alts = set()
configToAlts[s] = alts
configToAlts[h] = alts
alts.add(c.alt)
return configToAlts.values()

View File

@ -501,11 +501,11 @@ class PredictionMode(Enum):
def getConflictingAltSubsets(cls, configs:ATNConfigSet):
configToAlts = dict()
for c in configs:
s = str(c.state.stateNumber) + "/" + str(c.context)
alts = configToAlts.get(s, None)
h = hash((c.state.stateNumber, c.context))
alts = configToAlts.get(h, None)
if alts is None:
alts = set()
configToAlts[s] = alts
configToAlts[h] = alts
alts.add(c.alt)
return configToAlts.values()