MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / shuffle

Method shuffle

source/core/StarRandom.hpp:188–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186
187template <typename Container>
188void RandomSource::shuffle(Container& container) {
189 size_t max = container.size();
190 std::shuffle(container.begin(), container.end(), URBG<size_t>([this, max]() { return randUInt(max - 1); }));
191}
192
193template <typename Container>
194typename Container::value_type Random::randValueFrom(Container const& container) {

Callers 1

updateMethod · 0.80

Calls 5

randUIntFunction · 0.85
randu64Method · 0.80
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected