From e09c056a440e78afd0e1920250714bc6de6ccf4f Mon Sep 17 00:00:00 2001 From: Gregory Heytings Date: Wed, 20 Jul 2022 19:53:36 +0000 Subject: [PATCH] * src/xdisp.c (redisplay_window): Small optimization. --- src/xdisp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 4701e2b2459..2a6f32aa61f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -19295,15 +19295,16 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) && !current_buffer->long_line_optimizations_p && MODIFF - UNCHANGED_MODIFIED > 8) { - ptrdiff_t cur, next, found, max = 0; + ptrdiff_t cur, next, found, max = 0, threshold; + threshold = XFIXNUM (Vlong_line_threshold); for (cur = 1; cur < Z; cur = next) { next = find_newline1 (cur, CHAR_TO_BYTE (cur), 0, -1, 1, &found, NULL, true); if (next - cur > max) max = next - cur; - if (!found || max > XFIXNUM (Vlong_line_threshold)) break; + if (!found || max > threshold) break; } - if (max > XFIXNUM (Vlong_line_threshold)) + if (max > threshold) current_buffer->long_line_optimizations_p = true; } -- 2.39.5