forked from mirror/ledisdb
use a default initial maximum range count
This commit is contained in:
parent
eee7468b85
commit
1df83b61b4
|
@ -583,9 +583,10 @@ func (db *DB) zRange(key []byte, min int64, max int64, offset int, count int, re
|
||||||
return []ScorePair{}, nil
|
return []ScorePair{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
nv := 64
|
nv := count
|
||||||
if count > 0 {
|
// count may be very large, so we must limit it for below mem make.
|
||||||
nv = count
|
if nv <= 0 || nv > 1024 {
|
||||||
|
nv = 64
|
||||||
}
|
}
|
||||||
|
|
||||||
v := make([]ScorePair, 0, nv)
|
v := make([]ScorePair, 0, nv)
|
||||||
|
|
Loading…
Reference in New Issue