ImageGetter.getDrawable a few ns faster (#6936)

This commit is contained in:
SomeTroglodyte 2022-05-25 18:33:17 +02:00 committed by GitHub
parent 6f7af9ee22
commit e927ef6f64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 8 deletions

View File

@ -170,8 +170,7 @@ object ImageGetter {
} }
fun getDrawable(fileName: String?): TextureRegionDrawable { fun getDrawable(fileName: String?): TextureRegionDrawable {
return if (fileName != null && textureRegionDrawables.containsKey(fileName)) textureRegionDrawables[fileName]!! return textureRegionDrawables[fileName] ?: textureRegionDrawables[whiteDotLocation]!!
else textureRegionDrawables[whiteDotLocation]!!
} }
fun getRoundedEdgeRectangle(tintColor: Color? = null): NinePatchDrawable { fun getRoundedEdgeRectangle(tintColor: Color? = null): NinePatchDrawable {