lock: Make some cleanup and moving the code around. (#2718)

This patch just avoids lot of ifs and inverts some logic.
This commit is contained in:
Harshavardhana
2016-09-19 13:14:55 -07:00
committed by GitHub
parent a955676986
commit 113b93346b
11 changed files with 335 additions and 204 deletions

View File

@@ -235,7 +235,7 @@ func runGetObjectBenchmark(b *testing.B, obj ObjectLayer, objSize int) {
func getRandomByte() []byte {
const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
// seeding the random number generator.
rand.Seed(time.Now().UnixNano())
rand.Seed(time.Now().UTC().UnixNano())
var b byte
// pick a character randomly.
b = letterBytes[rand.Intn(len(letterBytes))]