mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-12-23 16:50:18 +01:00
Moved ordering of two int64 to common/math.
This commit is contained in:
parent
8817094001
commit
f6e5eb8510
@ -387,7 +387,7 @@ func (ldbs *LevelDBSession) interleavedSpatialQuery(
|
||||
|
||||
zmin, zmax := common.CoordToInterleaved(c1), common.CoordToInterleaved(c2)
|
||||
// Should not be necessary.
|
||||
zmin, zmax = order(zmin, zmax)
|
||||
zmin, zmax = common.Order64(zmin, zmax)
|
||||
var (
|
||||
cub = common.Cuboid{P1: c1, P2: c2}
|
||||
err error
|
||||
|
@ -1,12 +0,0 @@
|
||||
// Copyright 2014, 2015 by Sascha L. Teichmann
|
||||
// Use of this source code is governed by the MIT license
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package main
|
||||
|
||||
func order(a, b int64) (int64, int64) {
|
||||
if a < b {
|
||||
return a, b
|
||||
}
|
||||
return b, a
|
||||
}
|
@ -369,7 +369,7 @@ func (ss *SqliteSession) interleavedSpatialQuery(
|
||||
defer globalLock.RUnlock()
|
||||
zmin, zmax := common.CoordToInterleaved(c1), common.CoordToInterleaved(c2)
|
||||
// Should not be necessary.
|
||||
zmin, zmax = order(zmin, zmax)
|
||||
zmin, zmax = common.Order64(zmin, zmax)
|
||||
cub := common.Cuboid{P1: c1, P2: c2}
|
||||
rangeStmt := ss.txStmt(ss.backend.rangeStmt)
|
||||
|
||||
|
@ -58,3 +58,10 @@ func Clamp32f(x, a, b float32) float32 {
|
||||
}
|
||||
return x
|
||||
}
|
||||
|
||||
func Order64(a, b int64) (int64, int64) {
|
||||
if a < b {
|
||||
return a, b
|
||||
}
|
||||
return b, a
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user