Skip to content

Commit

Permalink
fix: make lookup opt as a option
Browse files Browse the repository at this point in the history
  • Loading branch information
liuq19 committed Jun 28, 2024
1 parent db8b064 commit ce291a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/optcaching/fcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"unicode"
"unsafe"

"github.com/bytedance/sonic/internal/envs"
"github.com/bytedance/sonic/internal/native"
"github.com/bytedance/sonic/internal/resolver"
"github.com/bytedance/sonic/internal/rt"
Expand Down Expand Up @@ -58,7 +59,7 @@ func NewFieldLookup(fields []resolver.FieldMeta) FieldLookup {

if n <= 8 {
f = NewSmallFieldMap(n)
} else if n <= 128 && isAsc {
} else if envs.UseFastMap && n <= 128 && isAsc {
f = NewNormalFieldMap(n)
} else {
f = NewFallbackFieldMap(n)
Expand Down

0 comments on commit ce291a7

Please sign in to comment.