Skip to content

Commit

Permalink
fix the list rpop func bug
Browse files Browse the repository at this point in the history
  • Loading branch information
SandTripper committed Jul 26, 2023
1 parent 97dd340 commit 641e711
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion structure/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (l *ListStructure) RPop(key string) (interface{}, error) {

// Find the new tail
newTail := lst.Head
for i := 0; i < lst.Length-1; i++ {
for i := 0; i < lst.Length-2; i++ {
newTail = newTail.Next
}
popValue := newTail.Next.Value
Expand Down

0 comments on commit 641e711

Please sign in to comment.