Skip to content

Commit

Permalink
chunk/paletted_storage.go: Replace usage of deprecated `reflect.Slice…
Browse files Browse the repository at this point in the history
…Header`
  • Loading branch information
DaPigGuy committed Dec 10, 2023
1 parent ba0ab9b commit aa07724
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions server/world/chunk/paletted_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package chunk

import (
"bytes"
"reflect"
"unsafe"
)

Expand Down Expand Up @@ -46,7 +45,7 @@ func newPalettedStorage(indices []uint32, palette *Palette) *PalettedStorage {
var (
bitsPerIndex = uint16(len(indices) / uint32BitSize / uint32ByteSize)
indexMask = (uint32(1) << bitsPerIndex) - 1
indicesStart = (unsafe.Pointer)((*reflect.SliceHeader)(unsafe.Pointer(&indices)).Data)
indicesStart = (unsafe.Pointer)(unsafe.SliceData(indices))
filledBitsPerIndex uint16
)
if bitsPerIndex != 0 {
Expand Down

0 comments on commit aa07724

Please sign in to comment.