graphics: Clear mipmap map to avoid unnecessary allocation (#799)

This change uses a pattern that Go 1.11+ compilers can optimize to a clear operation
https://github.com/golang/go/blob/master/doc/go1.11.html#L447
This commit is contained in:
Jake Bentvelzen 2019-01-27 23:30:30 +11:00 committed by Hajime Hoshi
parent 3ac1996f9d
commit 4cb79888fe

View File

@ -112,7 +112,9 @@ func (m *mipmap) disposeMipmaps() {
img.Dispose()
}
}
m.imgs = map[image.Rectangle][]*shareable.Image{}
for k := range m.imgs {
delete(m.imgs, k)
}
}
// Image represents a rectangle set of pixels.