| 190 | p += left; |
| 191 | right -= left; |
| 192 | } |
| 193 | else { /* A1 A2 B -> A1 B A2 (A2 is final) */ |
| 194 | alg_swap_bytes(p + left - right, p + left, right); |
| 195 | left -= right; |
| 196 | } |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | |
| 201 | /* Uniform random index in [0, bound) from a generator of uniformly random |
| 202 | * 32-bit values: rng() % bound, as algorithm_shuffle has always computed it, |
| 203 | * except that a draw from the incomplete top range (r >= the largest |
| 204 | * multiple of bound that fits in 2^32) is rejected and drawn again - that |
| 205 | * tail is what made rng() % bound favour small indices. Accepted draws give |
| 206 | * exactly the old index, so the same generator still gives the same |
no test coverage detected