From 080c6747fd2c7a42937be91360c02e07030804d0 Mon Sep 17 00:00:00 2001 From: nhmall Date: Thu, 4 Apr 2024 16:51:51 -0400 Subject: [PATCH] follow-up bit minor, but inner loop assignments to glyph and mapsym are only needed when corr_next2u is TRUE --- src/cmd.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/cmd.c b/src/cmd.c index 8700b2238..a81e80e57 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1316,14 +1316,17 @@ dolookaround(void) iflags.getloc_filter = GFILTER_VIEW; for (y = 0; y < ROWNO; y++) for (x = 1; x < COLNO; x++) { - int glyph = glyph_at(x, y), - mapsym = glyph_is_cmap(glyph) ? glyph_to_cmap(glyph) : -1; + int glyph, mapsym; + boolean iscorr = (corr_next2u + && (glyph = glyph_at(x, y)) >= 0 + && glyph_is_cmap(glyph) + && ((mapsym = glyph_to_cmap(glyph)) == S_corr + || mapsym == S_litcorr)); if (!u_at(x, y) && (gather_locs_interesting(x, y, GLOC_INTERESTING) /* note: GLOC_INTERESTING catches S_engrcorr */ - || (corr_next2u && (mapsym == S_corr - || mapsym == S_litcorr)))) { + || iscorr)) { char buf[BUFSZ]; coord cc; int sym = 0;