Skip to content

Commit

Permalink
Do not iterate in while when history cursor is outside of list range
Browse files Browse the repository at this point in the history
  • Loading branch information
planarvoid committed Oct 24, 2023
1 parent 1614ca1 commit 3f0d581
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 3f0d581

Please sign in to comment.