Replace elvis operators with .orEmpty where possible
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user