| 489 | } |
| 490 | |
| 491 | template<typename T> void Shuffle(std::vector<T>& values, Random& randomGenerator) |
| 492 | { |
| 493 | const uint64 count = values.size(); |
| 494 | for(uint64 i = 0; i < count; ++i) |
| 495 | { |
| 496 | uint64 other = i + (randomGenerator.RandomUint() % (count - i)); |
| 497 | Swap(values[i], values[other]); |
| 498 | } |
| 499 | } |
| 500 | |
| 501 | template<typename T> void Shuffle(T* values, uint64 count, Random& randomGenerator) |
| 502 | { |
nothing calls this directly
no test coverage detected