]> git.eshelyaron.com Git - emacs.git/commitdiff
* src/xdisp.c (string_from_display_spec): Simplify.
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 31 Dec 2016 17:13:38 +0000 (09:13 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 31 Dec 2016 17:16:36 +0000 (09:16 -0800)
src/xdisp.c

index 45a04caebfdb60b5bf56053f040985159e3e13a5..aced59e1b8e93cb09f552782fba7f7bfdd50af8d 100644 (file)
@@ -1250,26 +1250,18 @@ default_line_pixel_height (struct window *w)
 static Lisp_Object
 string_from_display_spec (Lisp_Object spec)
 {
-  if (CONSP (spec))
+  if (VECTORP (spec))
     {
-      do {
-       if (STRINGP (XCAR (spec)))
-         return XCAR (spec);
-       spec = XCDR (spec);
-      } while (CONSP (spec));
+      for (ptrdiff_t i = 0; i < ASIZE (spec); i++)
+       if (STRINGP (AREF (spec, i)))
+         return AREF (spec, i);
     }
-  else if (VECTORP (spec))
+  else
     {
-      ptrdiff_t i;
-
-      for (i = 0; i < ASIZE (spec); i++)
-       {
-         if (STRINGP (AREF (spec, i)))
-           return AREF (spec, i);
-       }
-      return Qnil;
+      for (; CONSP (spec); spec = XCDR (spec))
+       if (STRINGP (XCAR (spec)))
+         return XCAR (spec);
     }
-
   return spec;
 }