From: Chris Gregory Date: Sat, 31 Dec 2016 11:18:57 +0000 (+0200) Subject: Simplify code in 'string_from_display_spec' X-Git-Tag: emacs-26.0.90~981 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1da34d6a9dbe35fd83906a16a7f730298c3f8ab3;p=emacs.git Simplify code in 'string_from_display_spec' * src/xdisp.c (string_from_display_spec): Eliminate a redundant test before the loop. Copyright-paperwork-exempt: yes --- diff --git a/src/xdisp.c b/src/xdisp.c index 5de5ecaef0d..45a04caebfd 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -1252,12 +1252,11 @@ string_from_display_spec (Lisp_Object spec) { if (CONSP (spec)) { - while (CONSP (spec)) - { - if (STRINGP (XCAR (spec))) - return XCAR (spec); - spec = XCDR (spec); - } + do { + if (STRINGP (XCAR (spec))) + return XCAR (spec); + spec = XCDR (spec); + } while (CONSP (spec)); } else if (VECTORP (spec)) {