mirror of https://github.com/ledisdb/ledisdb.git
Optimize memory copy
This commit is contained in:
parent
1b1d2b74e1
commit
0fd6c150e8
|
@ -273,7 +273,7 @@ func (db *DB) HDel(key []byte, args ...[]byte) (int64, error) {
|
||||||
|
|
||||||
ek = db.hEncodeHashKey(key, args[i])
|
ek = db.hEncodeHashKey(key, args[i])
|
||||||
|
|
||||||
v = it.Find(ek)
|
v = it.RawFind(ek)
|
||||||
if v == nil {
|
if v == nil {
|
||||||
continue
|
continue
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -477,7 +477,7 @@ func (db *DB) zrank(key []byte, member []byte, reverse bool) (int64, error) {
|
||||||
for ; it.Valid(); it.Next() {
|
for ; it.Valid(); it.Next() {
|
||||||
n++
|
n++
|
||||||
|
|
||||||
lastKey = it.Key()
|
lastKey = it.BufKey(lastKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
it.Close()
|
it.Close()
|
||||||
|
@ -511,7 +511,7 @@ func (db *DB) zRemRange(t *tx, key []byte, min int64, max int64, offset int, cou
|
||||||
it := db.zIterator(key, min, max, offset, count, false)
|
it := db.zIterator(key, min, max, offset, count, false)
|
||||||
var num int64 = 0
|
var num int64 = 0
|
||||||
for ; it.Valid(); it.Next() {
|
for ; it.Valid(); it.Next() {
|
||||||
sk := it.Key()
|
sk := it.RawKey()
|
||||||
_, m, _, err := db.zDecodeScoreKey(sk)
|
_, m, _, err := db.zDecodeScoreKey(sk)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue