I want an inline function that filters through a list and returns the original list if there is no match rather than returning null
I have this feature that filters through the list and returns the filtered list or empty
fun List<Obj>?.filterQueryText(queryText : String?) = this?.filter {
queryText.equals(it.objName)
}.orEmpty()
How do I make it so that it will return to the original list if no match is found in the query?