Skip to content

Commit

Permalink
Merge pull request #191 from Mido-sys/upgrade_compiler
Browse files Browse the repository at this point in the history
upgrade unsafeGetBytes to use unsafe.slice
  • Loading branch information
paganotoni authored Aug 6, 2024
2 parents 3611e91 + 50d507f commit e1f0290
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions compiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,5 @@ func unsafeGetBytes(s string) []byte {
if s == "" {
return []byte{}
}
return (*[0x7fff0000]byte)(unsafe.Pointer(
(*reflect.StringHeader)(unsafe.Pointer(&s)).Data),
)[:len(s):len(s)]
return unsafe.Slice(unsafe.StringData(s), len(s))
}

0 comments on commit e1f0290

Please sign in to comment.