resolve some FxCop warnings

This commit is contained in:
Collin M. Barrett 2019-05-15 08:42:17 -05:00
parent 8ce7ba9c6f
commit f06673828f
3 changed files with 3 additions and 1 deletions

View file

@ -12,7 +12,7 @@ public static bool IsValidHttpOrHttpsUrl(this string source) =>
public static int GetNthIndexOfChar(this string s, int n, char t)
{
if (n < 1)
throw new ArgumentOutOfRangeException();
throw new ArgumentOutOfRangeException($"n = {n}");
var nthIndexOfChar = s.TakeWhile(c => (n -= c == t ? 1 : 0) > 0).Count();
return nthIndexOfChar == s.Length ? -1 : nthIndexOfChar;
}

View file

@ -70,5 +70,6 @@
</Rules>
<Rules AnalyzerId="Microsoft.CodeQuality.Analyzers" RuleNamespace="Microsoft.CodeQuality.Analyzers">
<Rule Id="CA2007" Action="None" />
<Rule Id="CA1707" Action="None" />
</Rules>
</RuleSet>

View file

@ -70,5 +70,6 @@
</Rules>
<Rules AnalyzerId="Microsoft.CodeQuality.Analyzers" RuleNamespace="Microsoft.CodeQuality.Analyzers">
<Rule Id="CA2007" Action="None" />
<Rule Id="CA1707" Action="None" />
</Rules>
</RuleSet>