From 441051a8ac1c5460eddca80a54d78e55985ee0f4 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Tue, 28 Jul 2020 12:56:40 -0700 Subject: [PATCH] Remove the cap on the number of iterations when tiling. This could trigger spuriously for very long lines outside the view box. It still indicates potential performance problem, but we shouldn't crash at least. Closes #416. --- renderer/src/tiler.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/renderer/src/tiler.rs b/renderer/src/tiler.rs index f7a021d0..32a1fc4c 100644 --- a/renderer/src/tiler.rs +++ b/renderer/src/tiler.rs @@ -224,12 +224,8 @@ fn process_line_segment(line_segment: LineSegment2F, let (mut current_position, mut tile_coords) = (line_segment.from(), from_tile_coords); let mut last_step_direction = None; - let mut iteration = 0; loop { - // Quick check to catch missing the end tile. - debug_assert!(iteration < MAX_ITERATIONS); - let next_step_direction = if t_max.x() < t_max.y() { StepDirection::X } else if t_max.x() > t_max.y() { @@ -302,11 +298,7 @@ fn process_line_segment(line_segment: LineSegment2F, current_position = next_position; last_step_direction = next_step_direction; - - iteration += 1; } - - const MAX_ITERATIONS: u32 = 1024; } #[derive(Clone, Copy, PartialEq, Debug)]