emacs-diffs
[Top][All Lists]
Advanced

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

scratch/igc db6e8bf3dd1: Simplify code of last change


From: Eli Zaretskii
Subject: scratch/igc db6e8bf3dd1: Simplify code of last change
Date: Sat, 27 Apr 2024 02:00:08 -0400 (EDT)

branch: scratch/igc
commit db6e8bf3dd1c59a4719c67e6557553797d84d320
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Simplify code of last change
    
    * src/xdisp.c (syms_of_xdisp): Use ARRAYELTS to simplify.
---
 src/xdisp.c | 33 +++++++++++++++------------------
 1 file changed, 15 insertions(+), 18 deletions(-)

diff --git a/src/xdisp.c b/src/xdisp.c
index 4d33052d063..c722afe069f 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -37397,26 +37397,23 @@ doesn't exist, it will be created and put into
 #ifdef HAVE_MPS
   this_line_buffer = NULL;
   igc_root_create_exact_ptr (&this_line_buffer);
-  {
-    size_t len = (sizeof default_invis_vector
-                 / sizeof (default_invis_vector[0]));
-    for (size_t i = 0; i < len; i++)
-      {
-       default_invis_vector[i] = Qnil;
-       staticpro (&default_invis_vector[i]);
-      }
-  }
+
+  for (size_t i = 0; i < ARRAYELTS (default_invis_vector); i++)
+    {
+      default_invis_vector[i] = Qnil;
+      staticpro (&default_invis_vector[i]);
+    }
+
   echo_area_window = Qnil;
   staticpro (&echo_area_window);
-  {
-    size_t len = sizeof (scratch_glyphs) / sizeof (scratch_glyphs[0]);
-    for (size_t i = 0; i < len; i++)
-      {
-       Lisp_Object *ptr = &scratch_glyphs[i].object;
-       *ptr = Qnil;
-       staticpro (ptr);
-      }
-  }
+
+  for (size_t i = 0; i < ARRAYELTS (scratch_glyphs); i++)
+    {
+      Lisp_Object *ptr = &scratch_glyphs[i].object;
+      *ptr = Qnil;
+      staticpro (ptr);
+    }
+
   displayed_buffer = NULL;
   igc_root_create_exact_ptr (&displayed_buffer);
   last_escape_glyph_frame = NULL;



reply via email to

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