diff --git a/bigcache_test.go b/bigcache_test.go index 38604c00..48d5efca 100644 --- a/bigcache_test.go +++ b/bigcache_test.go @@ -853,9 +853,5 @@ func (mc *mockedClock) set(value int64) { } func blob(char byte, len int) []byte { - b := make([]byte, len) - for index := range b { - b[index] = char - } - return b + return bytes.Repeat([]byte{char}, len) } diff --git a/queue/bytes_queue_test.go b/queue/bytes_queue_test.go index 9e408505..48b08538 100644 --- a/queue/bytes_queue_test.go +++ b/queue/bytes_queue_test.go @@ -369,11 +369,7 @@ func get(queue *BytesQueue, index int) []byte { } func blob(char byte, len int) []byte { - b := make([]byte, len) - for index := range b { - b[index] = char - } - return b + return bytes.Repeat([]byte{char}, len) } func assertEqual(t *testing.T, expected, actual interface{}, msgAndArgs ...interface{}) {