(key string, start int64, stop int64, forward bool)
| 265 | } |
| 266 | |
| 267 | func (c Client) zRange(key string, start int64, stop int64, forward bool) (membersWithScores map[string]float64, err error) { |
| 268 | if start < 0 && stop < 0 { |
| 269 | return c.zGeneralRange(key, negInf, posInf, -stop-1, -start, !forward, c.skN) |
| 270 | } |
| 271 | |
| 272 | if start > 0 && stop < 0 { |
| 273 | lastScore, err := c.zGeneralRange(key, negInf, posInf, -stop-1, 1, !forward, c.skN) |
| 274 | if err != nil { |
| 275 | return membersWithScores, err |
| 276 | } |
| 277 | |
| 278 | return c.zGeneralRange(key, negInf, zScore{floatValues(lastScore)[0]}, start, 0, forward, c.skN) |
| 279 | } |
| 280 | |
| 281 | return c.zGeneralRange(key, negInf, posInf, start, stop-start+1, forward, c.skN) |
| 282 | } |
| 283 | |
| 284 | func floatValues(floatValuedMap map[string]float64) (values []float64) { |
| 285 | for _, v := range floatValuedMap { |
no test coverage detected