File tree Expand file tree Collapse file tree 2 files changed +0
-37
lines changed
Expand file tree Collapse file tree 2 files changed +0
-37
lines changed Original file line number Diff line number Diff line change @@ -81,23 +81,6 @@ func (r *Rand) new_(seed ...uint64) {
8181 }
8282}
8383
84- // Get returns r, initializing it as if it was constructed by [New] if it was previously uninitialized.
85- // This allows to conveniently use Rand values non-deterministically without explicit initialization:
86- //
87- // type Dice struct {
88- // rng rand.Rand
89- // }
90- //
91- // func (d *Dice) Roll() int {
92- // return d.rng.Get().Intn(6)
93- // }
94- func (r * Rand ) Get () * Rand {
95- if r .w == 0 && * r == zero {
96- r .init0 ()
97- }
98- return r
99- }
100-
10184// Seed uses the provided seed value to initialize the generator to a deterministic state.
10285func (r * Rand ) Seed (seed uint64 ) {
10386 r .init1 (seed )
Original file line number Diff line number Diff line change @@ -283,26 +283,6 @@ func BenchmarkRand_NewInt(b *testing.B) {
283283 sinkInt = s
284284}
285285
286- func BenchmarkRand_Get (b * testing.B ) {
287- var r rand.Rand
288- var s * rand.Rand
289- b .ReportAllocs ()
290- for i := 0 ; i < b .N ; i ++ {
291- s = r .Get ()
292- }
293- sinkRand = s
294- }
295-
296- func BenchmarkRand_GetInt (b * testing.B ) {
297- var r rand.Rand
298- var s int
299- b .ReportAllocs ()
300- for i := 0 ; i < b .N ; i ++ {
301- s = r .Get ().Int ()
302- }
303- sinkInt = s
304- }
305-
306286func BenchmarkRand_ExpFloat64 (b * testing.B ) {
307287 var s float64
308288 r := rand .New (1 )
You can’t perform that action at this time.
0 commit comments