Skip to content

Commit

Permalink
NLogMessageParameterList - Reduce code complexity for IsValidParamete…
Browse files Browse the repository at this point in the history
…rList (2nd try) (#334)
  • Loading branch information
snakefoot authored and 304NotModified committed Sep 21, 2019
1 parent c6579b5 commit 38d3410
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/NLog.Extensions.Logging/Logging/NLogMessageParameterList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,14 @@ private static bool IsValidParameterList(IReadOnlyList<KeyValuePair<string, obje
char firstChar = parameterName[0];
if (firstChar >= '0' && firstChar <= '9')
{
if (!isPositional && i != 0)
isMixedPositional = true;
if (!isPositional)
isMixedPositional = i != 0;
isPositional = true;
}
else
{
if (isPositional)
{
isMixedPositional = true;
}

if (GetCaptureType(firstChar) != CaptureType.Normal)
{
hasMessageTemplateCapture = true;
}
isMixedPositional = isPositional;
hasMessageTemplateCapture |= GetCaptureType(firstChar) != CaptureType.Normal;
}
}

Expand Down

0 comments on commit 38d3410

Please sign in to comment.