once map key is found, can stop looking
Merge pull request #3248 from mtbc/terminate-loop-after-success

once map key is found, can stop looking