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.

This commit is contained in:
Sascha L. Teichmann 2014-09-07 11:07:49 +02:00
parent b40eb0021c
commit f83efba3cf

View File

@ -107,11 +107,11 @@ func DecodeFromBigEndian(key []byte) (int64, error) {
func CoordToInterleaved(c Coord) (result int64) { func CoordToInterleaved(c Coord) (result int64) {
const end = 1 << (numBitsPerComponent + 1) const end = 1 << (numBitsPerComponent + 1)
x := uint16(c.X - minValue) x := c.X - minValue
y := uint16(c.Y - minValue) y := c.Y - minValue
z := uint16(c.Z - minValue) z := c.Z - minValue
setmask := int64(1) setmask := int64(1)
for mask := uint16(1); mask != end; mask <<= 1 { for mask := int16(1); mask != end; mask <<= 1 {
if x&mask != 0 { if x&mask != 0 {
result |= setmask result |= setmask
} }