Skip to content

Commit

Permalink
Merge pull request #1065 from wordpress-mobile/fix/only-remove-actual…
Browse files Browse the repository at this point in the history
…-history-items

Do not iterate in while when history cursor is outside of list range
  • Loading branch information
khaykov authored Nov 6, 2023
2 parents 2b3694c + 12c557a commit c36ac5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aztec/src/main/kotlin/org/wordpress/aztec/History.kt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class History(val historyEnabled: Boolean, val historySize: Int) {
return
}

while (historyCursor != historyList.size && historyCursor >= 0) {
while (historyCursor in 0 until historyList.size) {
historyList.removeAt(historyCursor)
}

Expand Down

0 comments on commit c36ac5f

Please sign in to comment.