We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c536130 commit ee4df79Copy full SHA for ee4df79
src/LinkDotNet.Blog.Web/Features/Services/ReadingTimeCalculator.cs
@@ -24,12 +24,16 @@ public static int CalculateReadingTime(string content)
24
private static int GetWordCount(ReadOnlySpan<char> content)
25
{
26
var wordCount = 0;
27
- var index = 0;
28
- while ((index = content[index..].IndexOf(' ')) != -1)
+ for (var i = 0; i < content.Length; i++)
29
30
- wordCount++;
+ if (content[i] == ' ')
+ {
31
+ wordCount++;
32
+ }
33
}
34
35
return wordCount;
36
+
37
+ return wordCount;
38
39
0 commit comments