Skip to content

Commit b4ead6c

Browse files
authored
Move case insensitive lookup to use Ordinal comparison (#3690)
1 parent b245b8c commit b4ead6c

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

src/Npgsql/NpgsqlParameterCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ public override int IndexOf(string parameterName)
269269
// Case sensitive lookup failed, generate a case insensitive lookup
270270
if (_lookupIgnoreCase == null)
271271
{
272-
_lookupIgnoreCase = new Dictionary<string, int>(PGUtil.InvariantCaseIgnoringStringComparer);
272+
_lookupIgnoreCase = new Dictionary<string, int>(_internalList.Count, StringComparer.OrdinalIgnoreCase);
273273
for (var i = 0 ; i < _internalList.Count ; i++)
274274
{
275275
var item = _internalList[i];

src/Npgsql/Util/PGUtil.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ internal static int RotateShift(int val, int shift)
118118

119119
internal static readonly Task<bool> TrueTask = Task.FromResult(true);
120120
internal static readonly Task<bool> FalseTask = Task.FromResult(false);
121-
122-
internal static StringComparer InvariantCaseIgnoringStringComparer => StringComparer.InvariantCultureIgnoreCase;
123121
}
124122

125123
enum FormatCode : short

0 commit comments

Comments
 (0)