Remove not needed rand seeding

This commit is contained in:
Sergey Stepanov 2023-04-06 20:39:41 +03:00
parent b0b7966b47
commit e3ecd8fef0
No known key found for this signature in database
GPG key ID: A56B4929BAA8556B
6 changed files with 0 additions and 17 deletions

View file

@ -1,9 +1,6 @@
package main
import (
"math/rand"
"time"
config "github.com/giongto35/cloud-game/v3/pkg/config/coordinator"
"github.com/giongto35/cloud-game/v3/pkg/coordinator"
"github.com/giongto35/cloud-game/v3/pkg/logger"
@ -13,7 +10,6 @@ import (
var Version = "?"
func main() {
rand.New(rand.NewSource(time.Now().UnixNano())) // !to remove when bumped to 1.20
conf := config.NewConfig()
conf.ParseFlags()

View file

@ -1,7 +1,6 @@
package main
import (
"math/rand"
"time"
config "github.com/giongto35/cloud-game/v3/pkg/config/worker"
@ -14,7 +13,6 @@ import (
var Version = "?"
func run() {
rand.New(rand.NewSource(time.Now().UnixNano())) // !to remove when bumped to 1.20
conf := config.NewConfig()
conf.ParseFlags()

View file

@ -3,10 +3,8 @@ package zip
import (
cr "crypto/rand"
"fmt"
"math/rand"
"reflect"
"testing"
"time"
)
func TestCompression(t *testing.T) {
@ -63,7 +61,6 @@ func BenchmarkCompressions(b *testing.B) {
{name: "compress", size: 1024 * 1024 * 2},
}
for _, bm := range benchmarks {
rand.New(rand.NewSource(time.Now().UnixNano())) // !to remove when bumped to 1.20
b.Run(fmt.Sprintf("%v %v", bm.name, bm.size), func(b *testing.B) {
b.StopTimer()
dat := make([]byte, bm.size)

View file

@ -167,7 +167,6 @@ func TestStateConcurrency(t *testing.T) {
})
mock.handleAudio(func(_ *emulator.GameAudio) {})
rand.New(rand.NewSource(int64(test.seed))) // !to remove when bumped to 1.20
t.Logf("Random seed is [%v]\n", test.seed)
t.Logf("Save path is [%v]\n", mock.paths.save)

View file

@ -6,7 +6,6 @@ import (
"math/rand"
"reflect"
"testing"
"time"
"github.com/giongto35/cloud-game/v3/pkg/logger"
"github.com/giongto35/cloud-game/v3/pkg/worker/encoder"
@ -138,8 +137,6 @@ func BenchmarkResampler(b *testing.B) {
}
func gen(l int) []int16 {
rand.New(rand.NewSource(time.Now().UnixNano())) // !to remove when bumped to 1.20
nums := make([]int16, l)
for i := range nums {
nums[i] = int16(rand.Intn(10))

View file

@ -65,10 +65,6 @@ type (
}
)
func init() {
rand.New(rand.NewSource(time.Now().UnixNano())) // !to remove when bumped to 1.20
}
// NewRecording creates new media recorder for the emulator.
func NewRecording(meta Meta, log *logger.Logger, opts Options) *Recording {
savePath, err := filepath.Abs(opts.Dir)