Fix an off-by-one error in reporting dropped history items

This was introduced in the Rust port. The original C++ was pretty gnarly to be
fair.
This commit is contained in:
Peter Ammon
2025-06-19 11:08:50 -07:00
parent d369614ad9
commit fe8909e8f2

View File

@@ -309,7 +309,11 @@ fn test_history_races() {
continue;
};
// Remove everything from this item on
// Remove the item we found.
list.remove(position);
// We expected this item to be the last. Items after this item
// in this array were therefore not found in history.
let removed = list.drain(position..);
for line in removed.into_iter().rev() {
printf!("Item dropped from history: %ls\n", line);