summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-12-29 00:14:55 -0800
committerKaz Kylheku <kaz@kylheku.com>2020-12-29 00:14:55 -0800
commit9dae5ba49c7595355ddcf336032c2e12aa84be5f (patch)
tree40fb5c0327c5cde5d220a9d27bf929a782c09491 /lib.c
parent626cbfb9ac8e93bd55cd19a611c56f7cb34b8374 (diff)
downloadtxr-9dae5ba49c7595355ddcf336032c2e12aa84be5f.tar.gz
txr-9dae5ba49c7595355ddcf336032c2e12aa84be5f.tar.bz2
txr-9dae5ba49c7595355ddcf336032c2e12aa84be5f.zip
shuffle/nshuffle: eliminate wasteful vector copy.
* lib.c (nshuffle): When shuffling the vector that was converted from the list, use nshuffle rather shuffle, because it's a temporary, non-shared object we can mutate.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib.c b/lib.c
index c4150b60..b3873c95 100644
--- a/lib.c
+++ b/lib.c
@@ -9663,7 +9663,7 @@ val nshuffle(val seq)
case SEQ_LISTLIKE:
if (cdr(seq))
{
- val v = shuffle(vec_list(seq));
+ val v = nshuffle(vec_list(seq), randstate);
val i, l;
for (l = seq, i = zero; l; i = succ(i), l = cdr(l))