2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Fix -Wredundant-move and -Wdeprecated-copy warnings (#6663)

* Do not move result at end of function

This makes GCC 9.1.2 happy with the active -Wredundant-move warning.
Indeed, such moving of local variables or local arguments before
returning is unnecessary and prevents the compiler from copy elision
optimization.
This commit is contained in:
Nicholas Guriev
2019-11-12 18:15:34 +03:00
committed by John Preston
parent a196b0aba7
commit 793862bee6
34 changed files with 60 additions and 61 deletions

View File

@@ -344,7 +344,7 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
result,
st::infoIconInformation,
st::infoInformationIconPosition);
return std::move(result);
return result;
}
object_ptr<Ui::RpWidget> DetailsFiller::setupMuteToggle() {
@@ -365,7 +365,7 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupMuteToggle() {
result,
st::infoIconNotifications,
st::infoNotificationsIconPosition);
return std::move(result);
return result;
}
void DetailsFiller::setupMainButtons() {
@@ -775,7 +775,7 @@ object_ptr<Ui::RpWidget> ActionsFiller::fill() {
// result,
// st::infoIconNotifications,
// st::infoNotificationsIconPosition);
// return std::move(result);
// return result;
//}
} // namespace
@@ -870,7 +870,7 @@ object_ptr<Ui::RpWidget> SetupChannelMembers(
st::infoChannelMembersIconPosition);
members->add(CreateSkipWidget(members));
return std::move(result);
return result;
}
// // #feed
//object_ptr<Ui::RpWidget> SetupFeedDetails(