Simplify find syntax.

This commit is contained in:
Andrius Štikonas 2020-11-29 13:49:50 +00:00
parent 5da47c26e9
commit 04a095a542
1 changed files with 1 additions and 1 deletions

View File

@ -302,7 +302,7 @@ QVariantMap ExternalCommandHelper::RunCommand(const QString& command, const QStr
// Compare with command whitelist
QString basename = command.mid(command.lastIndexOf(QLatin1Char('/')) + 1);
if (std::find(std::begin(allowedCommands), std::end(allowedCommands), basename) == std::end(allowedCommands)) {
if (allowedCommands.find(basename) == allowedCommands.end()) { // TODO: C++20: replace with contains
qInfo() << command <<" command is not one of the whitelisted command";
reply[QStringLiteral("success")] = false;
return reply;