mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2025-06-30 15:10:55 +02:00
Fixed endless loop bug in LevelDB interleaved spatial query. Simplified code.
This commit is contained in:
@ -85,14 +85,22 @@ func EncodeStringToBytes(key int64) ([]byte, error) {
|
||||
return []byte(strconv.FormatInt(key, 10)), nil
|
||||
}
|
||||
|
||||
func EncodeToBigEndian(key int64) (enc []byte, err error) {
|
||||
enc = make([]byte, 8)
|
||||
func ToBigEndian(key int64) []byte {
|
||||
enc := make([]byte, 8)
|
||||
binary.BigEndian.PutUint64(enc, uint64(key))
|
||||
return
|
||||
return enc
|
||||
}
|
||||
|
||||
func EncodeToBigEndian(key int64) ([]byte, error) {
|
||||
return ToBigEndian(key), nil
|
||||
}
|
||||
|
||||
func FromBigEndian(key []byte) int64 {
|
||||
return int64(binary.BigEndian.Uint64(key))
|
||||
}
|
||||
|
||||
func DecodeFromBigEndian(key []byte) (int64, error) {
|
||||
return int64(binary.BigEndian.Uint64(key)), nil
|
||||
return FromBigEndian(key), nil
|
||||
}
|
||||
|
||||
func CoordToInterleaved(c Coord) (result int64) {
|
||||
|
Reference in New Issue
Block a user