From: Gerd Moellmann Date: Sun, 31 Oct 1999 02:04:50 +0000 (+0000) Subject: (Flength): Unroll loop over lists. X-Git-Tag: emacs-pretest-21.0.90~6248 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7843e09cdc402f6f9ea1a7f549180dff542d1cc0;p=emacs.git (Flength): Unroll loop over lists. --- diff --git a/src/ChangeLog b/src/ChangeLog index 234d50b4dd9..ab6e6771dce 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +1999-10-31 Gerd Moellmann + + * fns.c (Flength): Unroll loop over lists. + + * xdisp.c (append_space): Return non-zero if space was appended. + (display_line): Set charpos of first glyph to -1 only if that + glyph is the space added by append_glyph. + 1999-10-29 Kenichi Handa * coding.c (code_convert_region): Update `dst' correctly. diff --git a/src/fns.c b/src/fns.c index 148c03dca5f..5e70a36831c 100644 --- a/src/fns.c +++ b/src/fns.c @@ -148,11 +148,18 @@ To get the number of bytes, use `string-bytes'") XSETFASTINT (val, XVECTOR (sequence)->size & PSEUDOVECTOR_SIZE_MASK); else if (CONSP (sequence)) { - for (i = 0; CONSP (sequence); ++i) + i = 0; + while (CONSP (sequence)) { - if ((i & 0xff) == 0) - QUIT; sequence = XCDR (sequence); + ++i; + + if (!CONSP (sequence)) + break; + + sequence = XCDR (sequence); + ++i; + QUIT; } if (!NILP (sequence))