MCPcopy Create free account
hub / github.com/chen3feng/toft / RandomTarget

Method RandomTarget

container/skiplist_test.cpp:189–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187 }
188
189 static Key RandomTarget(Random* rnd) {
190 switch (rnd->Next() % 10) {
191 case 0:
192 // Seek to beginning
193 return MakeKey(0, 0);
194 case 1:
195 // Seek to end
196 return MakeKey(K, 0);
197 default:
198 // Seek to middle
199 return MakeKey(rnd->Next() % K, 0);
200 }
201 }
202
203 // Per-key generation
204 struct State {

Callers

nothing calls this directly

Calls 1

NextMethod · 0.45

Tested by

no test coverage detected