Use std::find instead of iterating to search in allowedCommands.

Authored by cjlcarvalho on Aug 24 2018, 3:14 PM.