mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
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:
parent
3ac1996f9d
commit
4cb79888fe
4
image.go
4
image.go
@ -112,7 +112,9 @@ func (m *mipmap) disposeMipmaps() {
|
|||||||
img.Dispose()
|
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.
|
// Image represents a rectangle set of pixels.
|
||||||
|
Loading…
Reference in New Issue
Block a user