diff --git a/common/coords.go b/common/coords.go index bd0d613..2657d8e 100644 --- a/common/coords.go +++ b/common/coords.go @@ -107,11 +107,11 @@ func DecodeFromBigEndian(key []byte) (int64, error) { func CoordToInterleaved(c Coord) (result int64) { const end = 1 << (numBitsPerComponent + 1) - x := uint16(c.X - minValue) - y := uint16(c.Y - minValue) - z := uint16(c.Z - minValue) + x := c.X - minValue + y := c.Y - minValue + z := c.Z - minValue setmask := int64(1) - for mask := uint16(1); mask != end; mask <<= 1 { + for mask := int16(1); mask != end; mask <<= 1 { if x&mask != 0 { result |= setmask }