use AsSpan instead of SubString

This commit is contained in:
irongut
2022-02-19 03:28:59 +00:00
parent 1c5e7f1a60
commit 4c876916c9
+2 -2
View File
@@ -249,10 +249,10 @@ namespace CodeCoverageSummary
}
else
{
if (!int.TryParse(thresholds.Substring(0, s), out lowerPercentage))
if (!int.TryParse(thresholds.AsSpan(0, s), out lowerPercentage))
throw new ArgumentException("Threshold parameter set incorrectly.");
if (!int.TryParse(thresholds.Substring(s + 1), out upperPercentage))
if (!int.TryParse(thresholds.AsSpan(s + 1), out upperPercentage))
throw new ArgumentException("Threshold parameter set incorrectly.");
}
lowerThreshold = lowerPercentage / 100.0;