TestImportExtremelyLargeImageWorks: optimize DevZero
According to go recognizes
(and optimizes for) the following syntax:
```go
for i := range b {
b[i] = 0
}
```
so let's use it. Limited testing shows ~7.5x speed increase,
compared to the previously used syntax.
@@ -20,8 +20,8 @@ var DevZero io.Reader = devZero{}
type devZero struct{}
func (d devZero) Read(p []byte) (n int, err error) {
- for i := 0; i < len(p); i++ {
- p[i] = '\x00'
+ for i := range p {
+ p[i] = 0
}
return len(p), nil
}
