Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentoub authored and veanes committed Nov 3, 2021
1 parent a5ca169 commit 970a4a8
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,7 @@ public DfaMatchingState<TSetType> TakeTransition(
Debug.Assert(builder._delta is not null);

int offset = (currentState.Id << builder._mintermsCount) | mintermId;
DfaMatchingState<TSetType>? p = Volatile.Read(ref builder._delta[offset]);
return p ?? matcher.CreateNewTransition(currentState, minterm, offset);
return Volatile.Read(ref builder._delta[offset]) ?? matcher.CreateNewTransition(currentState, minterm, offset);
}
}

Expand Down Expand Up @@ -390,8 +389,7 @@ public DfaMatchingState<TSetType> TakeTransition(
DfaMatchingState<TSetType> nextStates = builder.MkState(oneState, currentStates.PrevCharKind);

int offset = (nextStates.Id << builder._mintermsCount) | mintermId;
DfaMatchingState<TSetType>? p_ = Volatile.Read(ref builder._delta[offset]);
DfaMatchingState<TSetType> p = p_ ?? matcher.CreateNewTransition(nextStates, minterm, offset);
DfaMatchingState<TSetType> p = Volatile.Read(ref builder._delta[offset]) ?? matcher.CreateNewTransition(nextStates, minterm, offset);

// Observe that if p.Node is an Or it will be flattened.
union = builder.MkOr2(union, p.Node);
Expand Down

0 comments on commit 970a4a8

Please sign in to comment.