Doesn't this give you a warning? result may be undefined if you pass a string that you don't have.
If so then you (the programmer) has a problem and not the unit.

I'll benchmark the 2 functions a bit later ... I'm preocuppied at the moment.