Repository navigation
Fix adding to hash lookup while renaming an unnamed parameter - #6073
Conversation
| var oldTrimmedName = parameter.TrimmedName; | ||
| parameter.ChangeParameterName(value); | ||
|
|
||
| if (_caseInsensitiveLookup is null || _caseInsensitiveLookup.Count == 0) |
There was a problem hiding this comment.
Yeah this is a strange check, and it's not mirrored in any of the other operations...
Maybe at one point the idea was to allow the lookup to be fully bypassed again until the threshold would be reached once more.
There was a problem hiding this comment.
I think it was to support cached NpgsqlCommand, as for them we clear lookups, but do not null them. But yeah, since other checks ignore this case, it's better to just remove it from here rather than try to make the lookup completely lazy.
There was a problem hiding this comment.
That would end up doing the same thing right? We enable the lookup at some point and we never disable it.
I recall that when I made this there was some thought that it would be nice if we would drop back to the fast path until the threshold.
Seeing where we landed in the end - and in all other operations (lookupadd etc) we only check for null - I must have missed this check when I decided it was not worth the complexity.
Fixes #6067