remove unnecessary code (#13502)

slog is already lazily evaluated so this code is completely redundant
This commit is contained in:
Michael Yang 2025-12-16 15:11:26 -08:00 committed by GitHub
parent 903b1fc97f
commit 2dd029de12
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 11 deletions

View File

@ -2,9 +2,7 @@ package model
import ( import (
"cmp" "cmp"
"fmt"
"iter" "iter"
"log/slog"
"slices" "slices"
"strings" "strings"
@ -245,14 +243,6 @@ func (bpe BytePairEncoding) Encode(s string, addSpecial bool) ([]int32, error) {
return ids, nil return ids, nil
} }
type lazyIdsString struct {
ids []int32
}
func (l lazyIdsString) LogValue() slog.Value {
return slog.AnyValue(fmt.Sprint(l.ids))
}
func (bpe BytePairEncoding) Decode(ids []int32) (string, error) { func (bpe BytePairEncoding) Decode(ids []int32) (string, error) {
var sb strings.Builder var sb strings.Builder
for _, id := range ids { for _, id := range ids {
@ -277,6 +267,6 @@ func (bpe BytePairEncoding) Decode(ids []int32) (string, error) {
} }
} }
logutil.Trace("decoded", "string", sb.String(), "from", lazyIdsString{ids: ids}) logutil.Trace("decoded", "string", sb.String(), "from", ids)
return sb.String(), nil return sb.String(), nil
} }