From f83efba3cf8c4a300b17addc8ccf8e8372e6574e Mon Sep 17 00:00:00 2001 From: "Sascha L. Teichmann" Date: Sun, 7 Sep 2014 11:07:49 +0200 Subject: [PATCH] Temporarly converting components to uint16 in interleving is not needed because we are only interested in the bit patterns which are the same as in the signed representation. --- common/coords.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 }