From ce070307f0bd0936d0c077a932c574184d78ef7c Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Wed, 31 Jan 2001 12:22:58 +0000 Subject: [PATCH 1/1] (Fmake_list): Add a QUIT in the loop; unroll the loop. --- src/ChangeLog | 4 ++++ src/alloc.c | 34 ++++++++++++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index b977060629..ad4cbfab5c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2001-01-31 Gerd Moellmann + + * alloc.c (Fmake_list): Add a QUIT in the loop; unroll the loop. + 2001-01-31 Dave Love * textprop.c (Fset_text_properties): Fix newline in doc string. diff --git a/src/alloc.c b/src/alloc.c index 4134d26fbd..4affa42e68 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -2142,8 +2142,38 @@ DEFUN ("make-list", Fmake_list, Smake_list, 2, 2, 0, size = XFASTINT (length); val = Qnil; - while (size-- > 0) - val = Fcons (init, val); + while (size > 0) + { + val = Fcons (init, val); + --size; + + if (size > 0) + { + val = Fcons (init, val); + --size; + + if (size > 0) + { + val = Fcons (init, val); + --size; + + if (size > 0) + { + val = Fcons (init, val); + --size; + + if (size > 0) + { + val = Fcons (init, val); + --size; + } + } + } + } + + QUIT; + } + return val; } -- 2.20.1