From 62ca174d19105211a2cef1cd3f4bdede953af675 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sun, 4 Sep 2022 10:19:17 -0700 Subject: [PATCH] termwiz: remove assertions I don't think these are really necessary any more; the implementation cannot go out of bounds, so the worst that can happen is that we don't return any changes. refs: https://github.com/wez/wezterm/issues/2222 --- termwiz/src/surface/mod.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/termwiz/src/surface/mod.rs b/termwiz/src/surface/mod.rs index c66f34cfa..52e50b253 100644 --- a/termwiz/src/surface/mod.rs +++ b/termwiz/src/surface/mod.rs @@ -751,9 +751,6 @@ impl Surface { /// /// The returned list of `Change`s can be passed to the `add_changes` method /// to make the region within self match the region within other. - /// # Panics - /// Will panic if the regions of interest are not within the bounds of - /// their respective `Surface`. #[allow(clippy::too_many_arguments)] pub fn diff_region( &self, @@ -765,11 +762,6 @@ impl Surface { other_x: usize, other_y: usize, ) -> Vec { - assert!(x + width <= self.width); - assert!(y + height <= self.height); - assert!(other_x + width <= other.width); - assert!(other_y + height <= other.height); - let mut diff_state = DiffState::default(); for ((row_num, line), other_line) in self