avoid a panic when resizing a muxed tab as the first event

This commit is contained in:
Wez Furlong committed 2019-07-16 09:34:51 -07:00
1 parent 34ae350d88
commit 6ace6d4fcc
1 file changed
+2 -2
+2 -2
View File
@@ -534,11 +534,11 @@ impl Surface {
/// resources from the change log.
pub fn flush_changes_older_than(&mut self, seq: SequenceNo) {
let first = self.seqno.saturating_sub(self.changes.len());
let idx = seq - first;
let idx = seq.saturating_sub(first);
if idx > self.changes.len() {
return;
}
self.changes = self.changes.split_off(seq - first);
self.changes = self.changes.split_off(idx);
}
/// Without allocating resources, estimate how many Change entries