Update t_list.go

This commit is contained in:
Leither 2015-12-10 12:08:14 +08:00
parent 8003229696
commit df27eeedec
1 changed files with 3 additions and 1 deletions

View File

@ -346,7 +346,9 @@ func (db *DB) LSet(key []byte, index int32, value []byte) error {
} else { } else {
seq = tailSeq + index + 1 seq = tailSeq + index + 1
} }
if seq < headSeq || seq > tailSeq {
return errListIndex
}
sk := db.lEncodeListKey(key, seq) sk := db.lEncodeListKey(key, seq)
t.Put(sk, value) t.Put(sk, value)
err = t.Commit() err = t.Commit()