Skip to content

Commit b89d83a

Browse files
ViktorHoferdanmoseley
authored andcommitted
Refactor CheckTimeout to enable inlining (dotnet#27262)
1 parent cfe3ac1 commit b89d83a

File tree

1 file changed

+5
-4
lines changed
  • src/System.Text.RegularExpressions/src/System/Text/RegularExpressions

1 file changed

+5
-4
lines changed

src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexRunner.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,16 @@ protected void CheckTimeout()
206206
if (_ignoreTimeout)
207207
return;
208208

209-
if (--_timeoutChecksToSkip != 0)
210-
return;
211-
212-
_timeoutChecksToSkip = TimeoutCheckFrequency;
213209
DoCheckTimeout();
214210
}
215211

216212
private void DoCheckTimeout()
217213
{
214+
if (--_timeoutChecksToSkip != 0)
215+
return;
216+
217+
_timeoutChecksToSkip = TimeoutCheckFrequency;
218+
218219
// Note that both, Environment.TickCount and timeoutOccursAt are ints and can overflow and become negative.
219220
// See the comment in StartTimeoutWatch().
220221

0 commit comments

Comments
 (0)