changeset 18421:618cc7b75c06

(Freverse): Simplify.
author Richard M. Stallman <rms@gnu.org>
date Mon, 23 Jun 1997 18:56:17 +0000
parents 2de852dd7271
children 96deedadd2f0
files src/fns.c
diffstat 1 files changed, 6 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/fns.c	Mon Jun 23 17:53:11 1997 +0000
+++ b/src/fns.c	Mon Jun 23 18:56:17 1997 +0000
@@ -882,17 +882,13 @@
   (list)
      Lisp_Object list;
 {
-  Lisp_Object length;
-  register Lisp_Object *vec;
-  register Lisp_Object tail;
-  register int i;
+  Lisp_Object new;
 
-  length = Flength (list);
-  vec = (Lisp_Object *) alloca (XINT (length) * sizeof (Lisp_Object));
-  for (i = XINT (length) - 1, tail = list; i >= 0; i--, tail = Fcdr (tail))
-    vec[i] = Fcar (tail);
-
-  return Flist (XINT (length), vec);
+  for (new = Qnil; CONSP (list); list = XCONS (list)->cdr)
+    new = Fcons (XCONS (list)->car, new);
+  if (!NILP (list))
+    wrong_type_argument (Qconsp, list);
+  return new;
 }
 
 Lisp_Object merge ();