diff --git a/Jace/Util/EngineUtil.cs b/Jace/Util/EngineUtil.cs index 612b0c2..0b49867 100644 --- a/Jace/Util/EngineUtil.cs +++ b/Jace/Util/EngineUtil.cs @@ -25,7 +25,7 @@ static internal IDictionary ConvertVariableNamesToLowerCase(IDic static internal string ToLowerFast(this string text) { StringBuilder buffer = new StringBuilder(text.Length); - + bool modified = false; for(int i = 0; i < text.Length; i++) { char c = text[i]; @@ -33,6 +33,7 @@ static internal string ToLowerFast(this string text) if (c >= 'A' && c <= 'Z') { buffer.Append((char)(c + 32)); + modified = true; } else { @@ -40,7 +41,7 @@ static internal string ToLowerFast(this string text) } } - return buffer.ToString(); + return modified ? buffer.ToString() : text; } } }