scala/scala — pull request #2096 by ViniciusMiana (2013-02-08 18:05:27+00:00)
Title: SI-6370 changed ListMap apply0 method to produce correct error message

Current implementation of apply0 relies on tail method to iterate over all keys.
When the list gets to its end, tail produces an 'empty map' message in its exception, which is thrown by ListMap. This change checks if the collection is empty before calling tail and provides a more appropriate key not found message.

Implementation already discussed on PR: https://github.com/scala/scala/pull/2009
review by @phaller