If this change is made for performance reasons, wouldn't it make more sense to

- Try to find the value in the table using 'find'
- Handle exception if not found

instead of going through the map twice (once to check whether the value is in there, once to retrieve it).