update kv decr

This commit is contained in:
siddontang 2014-05-15 20:48:38 +08:00
parent e860902fef
commit 0f1856b7fc
2 changed files with 2 additions and 2 deletions

View File

@ -137,7 +137,7 @@ func decrbyCommand(c *client) error {
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
} else {
c.writeInteger(n)

View File

@ -51,7 +51,7 @@ func (db *DB) Decr(key []byte) (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) {