Interlocked.Increment returns the incremented value, not the original value
This commit is contained in:
parent
db1ee841c6
commit
68732032e0
|
@ -98,7 +98,7 @@ namespace Antlr4.Runtime.Dfa
|
|||
|
||||
public virtual DFAState AddState(DFAState state)
|
||||
{
|
||||
state.stateNumber = Interlocked.Increment(ref nextStateNumber);
|
||||
state.stateNumber = Interlocked.Increment(ref nextStateNumber) - 1;
|
||||
return states.GetOrAdd(state, state);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue