I'll bet you a six pack that hasName is called in a tight loop somewhere. The cost of generating the collection on every call is far greater than the cost of iterating it was.
Can we at least agree that the chosen example has too many other confounding factors in it?
Can we at least agree that the chosen example has too many other confounding factors in it?