Refactor whitespace skipping loop in KaraokeWordTransform

The condition checking and increment operation in the whitespace skipping loop inside the KaraokeWordTransform file has been refactored for better readability. The increment operation (i++) is now placed inside the loop block instead of the while statement.
This commit is contained in:
Ivandro Jao 2024-03-31 11:11:31 +01:00
parent e4bccc4dca
commit 9cc215b77d

View File

@ -27,7 +27,10 @@ namespace Nikse.SubtitleEdit.Core.Common.TextEffect
lastFontCloseIdx = i;
result.Add(karaoke);
// skip only whitespace
while (i < len && char.IsWhiteSpace(text[i])) i++;
while (i < len && char.IsWhiteSpace(text[i]))
{
i++;
}
}
}