mirror of https://github.com/ledisdb/ledisdb.git
update kv decr
This commit is contained in:
parent
e860902fef
commit
0f1856b7fc
|
@ -137,7 +137,7 @@ func decrbyCommand(c *client) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if n, err := c.db.DecrBy(c.args[0], -delta); err != nil {
|
if n, err := c.db.DecrBy(c.args[0], delta); err != nil {
|
||||||
return err
|
return err
|
||||||
} else {
|
} else {
|
||||||
c.writeInteger(n)
|
c.writeInteger(n)
|
||||||
|
|
|
@ -51,7 +51,7 @@ func (db *DB) Decr(key []byte) (int64, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (db *DB) DecrBy(key []byte, decrement int64) (int64, error) {
|
func (db *DB) DecrBy(key []byte, decrement int64) (int64, error) {
|
||||||
return db.incr(key, decrement)
|
return db.incr(key, -decrement)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (db *DB) Del(keys [][]byte) (int64, error) {
|
func (db *DB) Del(keys [][]byte) (int64, error) {
|
||||||
|
|
Loading…
Reference in New Issue