clang-tidy: use std::move where applicable (#2605)
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -26,7 +26,7 @@ const std::shared_ptr<QColor> ColorProvider::color(ColorType type) const
|
||||
void ColorProvider::updateColor(ColorType type, QColor color)
|
||||
{
|
||||
auto colorPtr = this->typeColorMap_.at(type);
|
||||
*colorPtr = color;
|
||||
*colorPtr = std::move(color);
|
||||
}
|
||||
|
||||
QSet<QColor> ColorProvider::recentColors() const
|
||||
|
||||
@@ -64,7 +64,7 @@ QColor TwitchAccount::color()
|
||||
|
||||
void TwitchAccount::setColor(QColor color)
|
||||
{
|
||||
this->color_.set(color);
|
||||
this->color_.set(std::move(color));
|
||||
}
|
||||
|
||||
bool TwitchAccount::setOAuthClient(const QString &newClientID)
|
||||
@@ -131,7 +131,7 @@ void TwitchAccount::blockUser(QString userId, std::function<void()> onSuccess,
|
||||
}
|
||||
onSuccess();
|
||||
},
|
||||
onFailure);
|
||||
std::move(onFailure));
|
||||
}
|
||||
|
||||
void TwitchAccount::unblockUser(QString userId, std::function<void()> onSuccess,
|
||||
@@ -149,7 +149,7 @@ void TwitchAccount::unblockUser(QString userId, std::function<void()> onSuccess,
|
||||
}
|
||||
onSuccess();
|
||||
},
|
||||
onFailure);
|
||||
std::move(onFailure));
|
||||
}
|
||||
|
||||
void TwitchAccount::checkFollow(const QString targetUserID,
|
||||
|
||||
@@ -58,7 +58,7 @@ void Helix::getUserByName(QString userName,
|
||||
HelixFailureCallback failureCallback)
|
||||
{
|
||||
QStringList userIds;
|
||||
QStringList userLogins{userName};
|
||||
QStringList userLogins{std::move(userName)};
|
||||
|
||||
this->fetchUsers(
|
||||
userIds, userLogins,
|
||||
@@ -78,7 +78,7 @@ void Helix::getUserById(QString userId,
|
||||
ResultCallback<HelixUser> successCallback,
|
||||
HelixFailureCallback failureCallback)
|
||||
{
|
||||
QStringList userIds{userId};
|
||||
QStringList userIds{std::move(userId)};
|
||||
QStringList userLogins;
|
||||
|
||||
this->fetchUsers(
|
||||
@@ -136,7 +136,8 @@ void Helix::getUserFollowers(
|
||||
QString userId, ResultCallback<HelixUsersFollowsResponse> successCallback,
|
||||
HelixFailureCallback failureCallback)
|
||||
{
|
||||
this->fetchUsersFollows("", userId, successCallback, failureCallback);
|
||||
this->fetchUsersFollows("", std::move(userId), std::move(successCallback),
|
||||
std::move(failureCallback));
|
||||
}
|
||||
|
||||
void Helix::getUserFollow(
|
||||
@@ -145,7 +146,7 @@ void Helix::getUserFollow(
|
||||
HelixFailureCallback failureCallback)
|
||||
{
|
||||
this->fetchUsersFollows(
|
||||
userId, targetId,
|
||||
std::move(userId), std::move(targetId),
|
||||
[successCallback](const auto &response) {
|
||||
if (response.data.empty())
|
||||
{
|
||||
@@ -155,7 +156,7 @@ void Helix::getUserFollow(
|
||||
|
||||
successCallback(true, response.data[0]);
|
||||
},
|
||||
failureCallback);
|
||||
std::move(failureCallback));
|
||||
}
|
||||
|
||||
void Helix::fetchStreams(
|
||||
@@ -209,7 +210,7 @@ void Helix::getStreamById(QString userId,
|
||||
ResultCallback<bool, HelixStream> successCallback,
|
||||
HelixFailureCallback failureCallback)
|
||||
{
|
||||
QStringList userIds{userId};
|
||||
QStringList userIds{std::move(userId)};
|
||||
QStringList userLogins;
|
||||
|
||||
this->fetchStreams(
|
||||
@@ -230,7 +231,7 @@ void Helix::getStreamByName(QString userName,
|
||||
HelixFailureCallback failureCallback)
|
||||
{
|
||||
QStringList userIds;
|
||||
QStringList userLogins{userName};
|
||||
QStringList userLogins{std::move(userName)};
|
||||
|
||||
this->fetchStreams(
|
||||
userIds, userLogins,
|
||||
@@ -299,7 +300,7 @@ void Helix::getGameById(QString gameId,
|
||||
ResultCallback<HelixGame> successCallback,
|
||||
HelixFailureCallback failureCallback)
|
||||
{
|
||||
QStringList gameIds{gameId};
|
||||
QStringList gameIds{std::move(gameId)};
|
||||
QStringList gameNames;
|
||||
|
||||
this->fetchGames(
|
||||
@@ -409,7 +410,7 @@ void Helix::createClip(QString channelId,
|
||||
break;
|
||||
}
|
||||
})
|
||||
.finally(finallyCallback)
|
||||
.finally(std::move(finallyCallback))
|
||||
.execute();
|
||||
}
|
||||
|
||||
@@ -653,8 +654,8 @@ NetworkRequest Helix::makeRequest(QString url, QUrlQuery urlQuery)
|
||||
|
||||
void Helix::update(QString clientId, QString oauthToken)
|
||||
{
|
||||
this->clientId = clientId;
|
||||
this->oauthToken = oauthToken;
|
||||
this->clientId = std::move(clientId);
|
||||
this->oauthToken = std::move(oauthToken);
|
||||
}
|
||||
|
||||
void Helix::initialize()
|
||||
|
||||
@@ -63,8 +63,8 @@ NetworkRequest Kraken::makeRequest(QString url, QUrlQuery urlQuery)
|
||||
|
||||
void Kraken::update(QString clientId, QString oauthToken)
|
||||
{
|
||||
this->clientId = clientId;
|
||||
this->oauthToken = oauthToken;
|
||||
this->clientId = std::move(clientId);
|
||||
this->oauthToken = std::move(oauthToken);
|
||||
}
|
||||
|
||||
void Kraken::initialize()
|
||||
|
||||
Reference in New Issue
Block a user