From c4a9771c8d48d239b95a451d286ba6844a06f704 Mon Sep 17 00:00:00 2001 From: JCOR11599 Date: Tue, 24 Jan 2023 09:17:15 +0000 Subject: [PATCH] [ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/update.sh --- go/libraries/doltcore/sqle/index/z_encoding.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/go/libraries/doltcore/sqle/index/z_encoding.go b/go/libraries/doltcore/sqle/index/z_encoding.go index fadbefbdbf..024778b7f5 100644 --- a/go/libraries/doltcore/sqle/index/z_encoding.go +++ b/go/libraries/doltcore/sqle/index/z_encoding.go @@ -77,9 +77,10 @@ func InterleaveUInt64(x, y uint64) uint64 { // It will put the bits in this order: x_0, y_0, x_1, y_1 ... x_63, Y_63 func ZValue(p types.Point) (z [2]uint64) { xLex, yLex := LexFloat(p.X), LexFloat(p.Y) - z[0], z[1] = InterleaveUInt64(xLex >> 32, yLex >> 32), InterleaveUInt64(xLex & 0xFFFFFFFF, yLex & 0xFFFFFFFF) + z[0], z[1] = InterleaveUInt64(xLex>>32, yLex>>32), InterleaveUInt64(xLex&0xFFFFFFFF, yLex&0xFFFFFFFF) return } + // UnInterleaveUint64 splits up the bits of the uint64 z into two uint64s // The first 32 bits of x and y must be 0. // Example: @@ -96,7 +97,7 @@ func ZValue(p types.Point) (z [2]uint64) { // 0000 0000 0000 0000 bdfh jlnp bdfh jlnp bdfh jlnp bdfh jlnp bdfh jlnp bdfh jlnp 0x00000000FFFFFFFF // 0000 0000 0000 0000 0000 0000 0000 0000 bdfh jlnp bdfh jlnp bdfh jlnp bdfh jlnp func UnInterleaveUint64(z uint64) (x, y uint64) { - x, y = z >> 1, z + x, y = z>>1, z for i := 4; i >= 0; i-- { x &= masks[i] x |= x >> shifts[i] @@ -138,13 +139,13 @@ func ZAddr(v types.GeometryValue) [17]byte { addr := [17]byte{} for i := 0; i < 2; i++ { for j := 0; j < 8; j++ { - addr[8 * i + j] = byte((zMin[i] >> (8 * (7 - j))) & 0xFF) + addr[8*i+j] = byte((zMin[i] >> (8 * (7 - j))) & 0xFF) } } if res := zMin[0] ^ zMax[0]; res != 0 { addr[16] = byte(bits.LeadingZeros64(res)) } else { - addr[16] = byte(64 + bits.LeadingZeros64(zMin[1] ^ zMax[1])) + addr[16] = byte(64 + bits.LeadingZeros64(zMin[1]^zMax[1])) } return addr