From 04a095a542d390e4cc987facd41dc65bf1c10e28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Sun, 29 Nov 2020 13:49:50 +0000 Subject: [PATCH] Simplify find syntax. --- src/util/externalcommandhelper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/externalcommandhelper.cpp b/src/util/externalcommandhelper.cpp index 05d44c5..da41261 100644 --- a/src/util/externalcommandhelper.cpp +++ b/src/util/externalcommandhelper.cpp @@ -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;