Skip to content

Commit

Permalink
Fix zset zrevrange err
Browse files Browse the repository at this point in the history
  • Loading branch information
zhs committed Jun 10, 2021
1 parent 5ab1439 commit 7da9319
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
3 changes: 0 additions & 3 deletions db/zset.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,6 @@ func (zset *ZSet) ZAnyOrderRange(start int64, stop int64, withScore bool, positi
if withScore {
val := []byte(strconv.FormatFloat(DecodeFloat64(score), 'f', -1, 64))
items = append(items, val)
if !positiveOrder {
items[len(items)-1], items[len(items)-2] = items[len(items)-2], items[len(items)-1]
}
}
}

Expand Down
3 changes: 0 additions & 3 deletions db/zset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,6 @@ func sortVals(member [][]byte, scores []float64, withScore, positiveOrder, bySco
if withScore {
data[idx+1] = []byte(strconv.FormatFloat(scores[i], 'f', -1, 64))
}
if !positiveOrder && withScore && !byScore {
data[idx], data[idx+1] = data[idx+1], data[idx]
}
}
return data
}
Expand Down

0 comments on commit 7da9319

Please sign in to comment.