-Performance improvements

This commit is contained in:
JamesNK
2012-01-08 00:54:53 +00:00
parent 1bd20261c2
commit 90297804e1
9 changed files with 149 additions and 98 deletions
@@ -93,8 +93,8 @@ namespace Newtonsoft.Json.Converters
private object ReadBson(BsonReader reader)
{
string regexText = (string)reader.Value;
int patternOptionDelimiterIndex = regexText.LastIndexOf(@"/");
string regexText = (string) reader.Value;
int patternOptionDelimiterIndex = regexText.LastIndexOf('/');
string patternText = regexText.Substring(1, patternOptionDelimiterIndex - 1);
string optionsText = regexText.Substring(patternOptionDelimiterIndex + 1);
@@ -134,7 +134,7 @@ namespace Newtonsoft.Json.Converters
reader.Read();
return new Regex(pattern, (RegexOptions)options);
return new Regex(pattern, (RegexOptions) options);
}
/// <summary>
@@ -149,4 +149,4 @@ namespace Newtonsoft.Json.Converters
return (objectType == typeof (Regex));
}
}
}
}