MCPcopy Create free account
hub / github.com/anse1/sqlsmith / random_pick

Function random_pick

random.hh:25–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23
24template<typename I>
25I random_pick(I beg, I end) {
26 if (beg == end)
27 throw std::runtime_error("No candidates available");
28
29 std::uniform_int_distribution<> pick(0, std::distance(beg, end) - 1);
30 std::advance(beg, pick(smith::rng));
31 return beg;
32}
33
34template<typename I>
35I random_pick(std::pair<I,I> iters) {

Callers 11

table_or_query_nameMethod · 0.85
target_tableMethod · 0.85
table_sampleMethod · 0.85
simple_join_condMethod · 0.85
pick_victimMethod · 0.85
upsert_stmtMethod · 0.85
column_referenceMethod · 0.85
comparison_opMethod · 0.85
funcallMethod · 0.85
atomic_subselectMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected