When you see code like this, and it was written by me, it's there for performance. Notice there are no toStreams, maps, filters, headOptions, or getOrElses, all of which involve allocations. It isn't because I don't know how to do it one line.