From 9dae5ba49c7595355ddcf336032c2e12aa84be5f Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 29 Dec 2020 00:14:55 -0800 Subject: 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. --- lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)) -- cgit v1.2.3