(concat): Move side effect outside of macro call.
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 8 Feb 2008 16:18:45 +0000 (16:18 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 8 Feb 2008 16:18:45 +0000 (16:18 +0000)
(hash_clear): Use ASET.

src/ChangeLog
src/fns.c

index 350e557..a02c3e6 100644 (file)
@@ -1,3 +1,8 @@
+2008-02-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * fns.c (concat): Move side effect outside of macro call.
+       (hash_clear): Use ASET.
+
 2008-02-08  Richard Stallman  <rms@gnu.org>
 
        * frame.c (Fdelete_frame): If FORCE, don't call hooks.
index 3a12768..d3f128e 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -727,7 +727,10 @@ concat (nargs, args, target_type, last_special)
                thisindex++;
              }
            else
-             elt = AREF (this, thisindex++);
+             {
+               elt = AREF (this, thisindex);
+               thisindex++;
+             }
 
            /* Store this element into the result.  */
            if (toindex < 0)
@@ -737,7 +740,10 @@ concat (nargs, args, target_type, last_special)
                tail = XCDR (tail);
              }
            else if (VECTORP (val))
-             AREF (val, toindex++) = elt;
+             {
+               ASET (val, toindex, elt);
+               toindex++;
+             }
            else
              {
                CHECK_NUMBER (elt);
@@ -4239,7 +4245,7 @@ hash_clear (h)
        }
 
       for (i = 0; i < ASIZE (h->index); ++i)
-       AREF (h->index, i) = Qnil;
+       ASET (h->index, i, Qnil);
 
       h->next_free = make_number (0);
       h->count = 0;