From 970a4a80470820af11e270854118a59280f0eb9c Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Wed, 3 Nov 2021 09:55:03 -0400 Subject: [PATCH] Apply suggestions from code review --- .../RegularExpressions/Symbolic/SymbolicRegexMatcher.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexMatcher.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexMatcher.cs index 11675f85bcbe4..a8cec12036225 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexMatcher.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexMatcher.cs @@ -359,8 +359,7 @@ public DfaMatchingState TakeTransition( Debug.Assert(builder._delta is not null); int offset = (currentState.Id << builder._mintermsCount) | mintermId; - DfaMatchingState? 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); } } @@ -390,8 +389,7 @@ public DfaMatchingState TakeTransition( DfaMatchingState nextStates = builder.MkState(oneState, currentStates.PrevCharKind); int offset = (nextStates.Id << builder._mintermsCount) | mintermId; - DfaMatchingState? p_ = Volatile.Read(ref builder._delta[offset]); - DfaMatchingState p = p_ ?? matcher.CreateNewTransition(nextStates, minterm, offset); + DfaMatchingState 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);