From e42d778db0ef69cb3a01c6c51c7167906b59f408 Mon Sep 17 00:00:00 2001 From: Marc Brooks Date: Wed, 14 May 2014 16:35:48 -0500 Subject: [PATCH] Brackets have no case. Swapped in StringComparison.Ordinal for the literal comparison against [ and ] since those are non-caseable. This is a micro-improvement, but still good practice. --- Src/Newtonsoft.Json/Linq/JTokenReader.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Src/Newtonsoft.Json/Linq/JTokenReader.cs b/Src/Newtonsoft.Json/Linq/JTokenReader.cs index eb50635b..0c541371 100644 --- a/Src/Newtonsoft.Json/Linq/JTokenReader.cs +++ b/Src/Newtonsoft.Json/Linq/JTokenReader.cs @@ -341,8 +341,8 @@ namespace Newtonsoft.Json.Linq if (string.IsNullOrEmpty(path)) return _initialPath; - if (_initialPath.EndsWith("]", StringComparison.OrdinalIgnoreCase) - || path.StartsWith("[", StringComparison.OrdinalIgnoreCase)) + if (_initialPath.EndsWith("]", StringComparison.Ordinal) + || path.StartsWith("[", StringComparison.Ordinal)) path = _initialPath + path; else path = _initialPath + "." + path; @@ -352,4 +352,4 @@ namespace Newtonsoft.Json.Linq } } } -} \ No newline at end of file +}