Explorar o código

Fix `gb_shuffle`

gingerBill %!s(int64=4) %!d(string=hai) anos
pai
achega
f29b51efdd
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/gb/gb.h

+ 1 - 1
src/gb/gb.h

@@ -6162,7 +6162,7 @@ void gb_shuffle(void *base, isize count, isize size) {
 
 	a = cast(u8 *)base + (count-1) * size;
 	for (i = count; i > 1; i--) {
-		j = gb_random_gen_isize(&random) % i;
+		j = cast(usize)gb_random_gen_u64(&random) % i;
 		gb_memswap(a, cast(u8 *)base + j*size, size);
 		a -= size;
 	}