From 4c876916c916191e3d0df620c20880e311758a31 Mon Sep 17 00:00:00 2001 From: irongut Date: Sat, 19 Feb 2022 03:28:59 +0000 Subject: [PATCH] use AsSpan instead of SubString --- src/CodeCoverageSummary/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CodeCoverageSummary/Program.cs b/src/CodeCoverageSummary/Program.cs index 71db0bd..4510201 100644 --- a/src/CodeCoverageSummary/Program.cs +++ b/src/CodeCoverageSummary/Program.cs @@ -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;