Performance improvements for shuffle and partial_shuffle
#1272
+205
−19
shuffle and partial_shuffle
#1272