simplify getHighlight logic

This commit is contained in:
David Langley 2021-07-23 14:29:37 +01:00
parent 608a1d3f8f
commit 5d092ce18a
1 changed files with 1 additions and 1 deletions

View File

@ -105,7 +105,7 @@ data class PushRule(
* Get the highlight status. As spec mentions assume false if no tweak present.
*/
fun getHighlight(): Boolean {
return (getActions().firstOrNull { it is Action.Highlight } as? Action.Highlight)?.highlight.orFalse()
return getActions().filterIsInstance<Action.Highlight>().firstOrNull()?.highlight.orFalse()
}
/**