KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
How can I refactor this code in functional style (scala idiomatic) def findFirst[T](objects: List[T]):T = { for (obj <- objects) { if (expensiveFunc(obj) != null) return obj } null.asInstanceOf[T] }
Tags (comma-separated)
Save Edits
Cancel