emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master dc49db7: Remove two uses of 'min' in Fwindow_text_p


From: Martin Rudalics
Subject: [Emacs-diffs] master dc49db7: Remove two uses of 'min' in Fwindow_text_pixel_size
Date: Fri, 24 Jun 2016 08:00:49 +0000 (UTC)

branch: master
commit dc49db725e2d1648cbf1f94cef6131d42b13237b
Author: Martin Rudalics <address@hidden>
Commit: Martin Rudalics <address@hidden>

    Remove two uses of 'min' in Fwindow_text_pixel_size
    
    * src/xdisp.c (Fwindow_text_pixel_size): Don't use 'min' since
    it calls move_it_to twice.  Suggested by Eli Zaretskii.
---
 src/xdisp.c |   19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/src/xdisp.c b/src/xdisp.c
index 9df73f2..1289515 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -9979,18 +9979,21 @@ include the height of both, if present, in the return 
value.  */)
       it.last_visible_x = max_x;
       /* Actually, we never want move_it_to stop at to_x.  But to make
         sure that move_it_in_display_line_to always moves far enough,
-        we set it to INT_MAX and specify MOVE_TO_X.  Also bound width
-        value by X-LIMIT.  */
-      x = min (move_it_to (&it, end, INT_MAX, max_y, -1,
-                          MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y),
-              max_x);
+        we set it to INT_MAX and specify MOVE_TO_X.  */
+      x = move_it_to (&it, end, INT_MAX, max_y, -1,
+                     MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y);
+      /* Don't return more than X-LIMIT.  */
+      if (x > max_x)
+        x = max_x;
     }
 
   /* Subtract height of header-line which was counted automatically by
      start_display.  */
-  y = min (it.current_y + it.max_ascent + it.max_descent
-          - WINDOW_HEADER_LINE_HEIGHT (w),
-          max_y);
+  y = it.current_y + it.max_ascent + it.max_descent
+    - WINDOW_HEADER_LINE_HEIGHT (w);
+  /* Don't return more than Y-LIMIT.  */
+  if (y > max_y)
+    y = max_y;
 
   if (EQ (mode_and_header_line, Qheader_line)
       || EQ (mode_and_header_line, Qt))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]