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)
  • Loading branch information
snakefoot committed Sep 16, 2019
1 parent c6579b5 commit fa66951
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 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,13 @@ private static bool IsValidParameterList(IReadOnlyList<KeyValuePair<string, obje
char firstChar = parameterName[0];
if (firstChar >= '0' && firstChar <= '9')
{
if (!isPositional && i != 0)
isMixedPositional = true;
isMixedPositional |= (!isPositional && 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 fa66951

Please sign in to comment.