From 4df38245e7f8daef46fc46dbf1d88e389fa8730b Mon Sep 17 00:00:00 2001 From: Tad Hardesty Date: Sun, 17 Nov 2019 10:27:25 -0800 Subject: [PATCH] Avoid reads from atom.loc in minimap::generate --- src/tools/minimap.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tools/minimap.rs b/src/tools/minimap.rs index 38f7cf75..01921b51 100644 --- a/src/tools/minimap.rs +++ b/src/tools/minimap.rs @@ -57,7 +57,10 @@ pub fn generate(ctx: Context, icon_cache: &IconCache) -> Result { if x < ctx.min.0 || x > ctx.max.0 { continue; } - 'atom: for mut atom in get_atom_list(objtree, &map.dictionary[e], (x as u32, y as u32), render_passes, Some(ctx.errors)) { + + let loc = (x as u32, y as u32); + + 'atom: for mut atom in get_atom_list(objtree, &map.dictionary[e], loc, render_passes, Some(ctx.errors)) { for pass in render_passes.iter() { // Note that late_filter is NOT called during smoothing lookups. if !pass.late_filter(&atom, objtree) { @@ -86,7 +89,6 @@ pub fn generate(ctx: Context, icon_cache: &IconCache) -> Result { } // smoothing time - let loc = atom.loc; icon_smoothing::handle_smooth(&mut underlays, ctx, atom, !0); sprites.extend(underlays.drain(..).map(|o| (loc, o))); sprites.extend(overlays.drain(..).map(|o| (loc, o)));