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.
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user