mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-21 08:09:35 +08:00
Avoid back and forth string conversions
This commit is contained in:
parent
6cc7c700b8
commit
a3ca277eaf
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user