Skip to content

Commit

Permalink
internal/eval: fix tests for GEORADIUSBYMEMBER command and linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
benbarten committed Dec 8, 2024
1 parent 275bcc6 commit 203f35d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/eval/eval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9250,7 +9250,7 @@ func testEvalGEORADIUSBYMEMBER(t *testing.T, store *dstore.Store) {
},
"GEORADIUSBYMEMBER wrong type operation": {
setup: func() {
store.Put("wrongtype", store.NewObj("string_value", -1, object.ObjTypeString, object.ObjEncodingRaw))
store.Put("wrongtype", store.NewObj("string_value", -1, object.ObjTypeString))
},
input: []string{"wrongtype", "wtc one", "7", "km"},
migratedOutput: EvalResponse{
Expand Down
4 changes: 2 additions & 2 deletions internal/eval/geo/geo.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func Area(centerHash, radius float64) (result [9]uint64, steps uint8) {
steps = geohashEstimateStepsByRadius(radius, centerLat)
centerRadiusHash := encodeHash(centerLon, centerLat, steps)

neighbors := geohashNeighbors(uint64(centerRadiusHash), steps)
neighbors := geohashNeighbors(centerRadiusHash, steps)
area := areaBySteps(centerRadiusHash, steps)

/* Check if the step is enough at the limits of the covered area.
Expand Down Expand Up @@ -290,7 +290,7 @@ func Area(centerHash, radius float64) (result [9]uint64, steps uint8) {

// HashMinMax returns the min and max hashes for a given hash and steps. This can be used to get the range of hashes
// that a given hash and a radius (steps) will cover.
func HashMinMax(hash uint64, steps uint8) (minHash uint64, maxHash uint64) {
func HashMinMax(hash uint64, steps uint8) (minHash, maxHash uint64) {
minHash = align52Bits(hash, steps)
hash++
maxHash = align52Bits(hash, steps)
Expand Down
1 change: 0 additions & 1 deletion internal/eval/sortedset/sorted_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ func DeserializeSortedSet(buf *bytes.Reader) (*Set, error) {
// GetScoreRange returns a slice of members with scores between min and max, inclusive.
// If withScores is true, the members will be returned with their scores.
func (ss *Set) GetMemberScoresInRange(minScore, maxScore float64, count, maxCount int) (members []string, scores []float64) {

iterFunc := func(item btree.Item) bool {
ssi := item.(*Item)
if ssi.Score < minScore {
Expand Down

0 comments on commit 203f35d

Please sign in to comment.