Skip to content

Commit a53c195

Browse files
committed
fix after merge
1 parent 9f64dcb commit a53c195

File tree

3 files changed

+1
-10
lines changed

3 files changed

+1
-10
lines changed

model/labels/labels_common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,5 +230,5 @@ func contains(s []Label, n string) bool {
230230
}
231231

232232
func yoloString(b []byte) string {
233-
return *((*string)(unsafe.Pointer(&b)))
233+
return unsafe.String(unsafe.SliceData(b), len(b))
234234
}

model/labels/labels_dedupelabels.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"slices"
2121
"strings"
2222
"sync"
23-
"unsafe"
2423

2524
"github.com/cespare/xxhash/v2"
2625
)
@@ -445,10 +444,6 @@ func EmptyLabels() Labels {
445444
return Labels{}
446445
}
447446

448-
func yoloString(b []byte) string {
449-
return unsafe.String(unsafe.SliceData(b), len(b))
450-
}
451-
452447
// New returns a sorted Labels from the given labels.
453448
// The caller has to guarantee that all label names are unique.
454449
// Note this function is not efficient; should not be used in performance-critical places.

model/labels/labels_stringlabels.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,6 @@ func EmptyLabels() Labels {
299299
return Labels{}
300300
}
301301

302-
func yoloString(b []byte) string {
303-
return unsafe.String(unsafe.SliceData(b), len(b))
304-
}
305-
306302
func yoloBytes(s string) []byte {
307303
return unsafe.Slice(unsafe.StringData(s), len(s))
308304
}

0 commit comments

Comments
 (0)