From 1da34d6a9dbe35fd83906a16a7f730298c3f8ab3 Mon Sep 17 00:00:00 2001 From: Chris Gregory Date: Sat, 31 Dec 2016 13:18:57 +0200 Subject: [PATCH] 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 --- src/xdisp.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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)) { -- 2.39.5