Skip to content

Commit

Permalink
fix: NormalFieldMap should set lowOffset=-1 when caseSensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
AsterDY committed Nov 22, 2024
1 parent f6f80cf commit 285504e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/optcaching/fcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,12 @@ const _HdrSize = _HdrSlot * 5
func (self *NormalFieldMap) Get(name string, caseSensitive bool) int {
// small keys use native C
if len(name) <= 32 {
_ = native.LookupSmallKey
return native.LookupSmallKey(&name, &self.keys, self.lowOffset);
_ = native.LookupSmallKey
lowOffset := self.lowOffset
if caseSensitive {
lowOffset = -1
}
return native.LookupSmallKey(&name, &self.keys, lowOffset);
}
return self.getLongKey(name, caseSensitive)
}
Expand Down

0 comments on commit 285504e

Please sign in to comment.