Replace elvis operators with .orEmpty where possible

This commit is contained in:
Jobobby04
2020-11-04 22:10:13 -05:00
parent 015c610205
commit 079dd953bd
23 changed files with 59 additions and 59 deletions
@@ -83,7 +83,7 @@ class MetadataViewController : NucleusController<MetadataViewControllerBinding,
fun onNextMangaInfo(meta: RaisedSearchMetadata?) {
val context = view?.context ?: return
data = meta?.getExtraInfoPairs(context) ?: emptyList()
data = meta?.getExtraInfoPairs(context).orEmpty()
adapter?.update(data)
}
}
@@ -54,7 +54,7 @@ class PururinDescriptionAdapter(
} ?: genre?.name ?: itemView.context.getString(R.string.unknown)
}
binding.uploader.text = meta.uploaderDisp ?: meta.uploader ?: ""
binding.uploader.text = meta.uploaderDisp ?: meta.uploader.orEmpty()
binding.size.text = meta.fileSize ?: itemView.context.getString(R.string.unknown)
binding.size.bindDrawable(itemView.context, R.drawable.ic_outline_sd_card_24)
@@ -32,7 +32,7 @@ class SmartSearchController(bundle: Bundle? = null) : NucleusController<EhSmartS
return binding.root
}
override fun getTitle() = source?.name ?: ""
override fun getTitle() = source?.name.orEmpty()
override fun createPresenter() = SmartSearchPresenter(source, smartSearchConfig)