While loop is a bit cleaner

This commit is contained in:
Tydude4Christ
2016-03-02 08:59:37 -06:00
parent d9ff3ee160
commit 259b21978e
+2 -1
View File
@@ -178,8 +178,9 @@ namespace Newtonsoft.Json.Utilities
char[] chars = s.ToCharArray(); char[] chars = s.ToCharArray();
int toLowerUntilIndex = 1; int toLowerUntilIndex = 1;
for(; toLowerUntilIndex < chars.Length && char.IsUpper(chars[toLowerUntilIndex]); ++toLowerUntilIndex) while (toLowerUntilIndex < chars.Length && char.IsUpper(chars[toLowerUntilIndex]))
{ {
++toLowerUntilIndex;
} }
// decrement if starts with consecutive upper case letters but is not all upper // decrement if starts with consecutive upper case letters but is not all upper
if (toLowerUntilIndex > 1 && toLowerUntilIndex < chars.Length) if (toLowerUntilIndex > 1 && toLowerUntilIndex < chars.Length)