Skip to content

Commit 5626340

Browse files
authored
Merge pull request #244 from SandTripper/fix_list_rpop_bug
fix the list rpop func bug
2 parents 97dd340 + 641e711 commit 5626340

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

structure/list.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ func (l *ListStructure) RPop(key string) (interface{}, error) {
212212

213213
// Find the new tail
214214
newTail := lst.Head
215-
for i := 0; i < lst.Length-1; i++ {
215+
for i := 0; i < lst.Length-2; i++ {
216216
newTail = newTail.Next
217217
}
218218
popValue := newTail.Next.Value

0 commit comments

Comments
 (0)