From a3ca277eafbfbe1d7e0d9896fa3f772c1f31c188 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 4 Aug 2019 16:44:12 +0800 Subject: [PATCH] Avoid back and forth string conversions --- src/webui/api/apicontroller.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/webui/api/apicontroller.cpp b/src/webui/api/apicontroller.cpp index c306a351b..40de8dcdf 100644 --- a/src/webui/api/apicontroller.cpp +++ b/src/webui/api/apicontroller.cpp @@ -45,8 +45,8 @@ QVariant APIController::run(const QString &action, const StringMap ¶ms, cons m_params = params; m_data = data; - const QString methodName {action + QLatin1String("Action")}; - if (!QMetaObject::invokeMethod(this, methodName.toLatin1().constData())) + const QByteArray methodName = action.toLatin1() + "Action"; + if (!QMetaObject::invokeMethod(this, methodName.constData())) throw APIError(APIErrorType::NotFound); return m_result;