summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-11-13 21:34:22 +0100
committerGravatar bstoeger <32835590+bstoeger@users.noreply.github.com>2019-11-14 09:36:39 +0100
commitf6d3efc6f8b6914a9b2fdb3d5d74ef4a97f55096 (patch)
treeb8e88516374f19a966fbd3407afb63c6d1d49716 /desktop-widgets
parent46088e63fd419d3eceae8c1c45dcec87a35badf3 (diff)
downloadsubsurface-f6d3efc6f8b6914a9b2fdb3d5d74ef4a97f55096.tar.gz
Cleanup: don't std::move() temporaries
clang correctly warns about std::move()ing objects returned from functions. This is a pessimization, because the compiler can't copy elide the object. Remove. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/command_divesite.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/desktop-widgets/command_divesite.cpp b/desktop-widgets/command_divesite.cpp
index 3ef4231f8..b5fb46f91 100644
--- a/desktop-widgets/command_divesite.cpp
+++ b/desktop-widgets/command_divesite.cpp
@@ -88,12 +88,12 @@ bool AddDiveSite::workToBeDone()
void AddDiveSite::redo()
{
- sitesToRemove = std::move(addDiveSites(sitesToAdd));
+ sitesToRemove = addDiveSites(sitesToAdd);
}
void AddDiveSite::undo()
{
- sitesToAdd = std::move(removeDiveSites(sitesToRemove));
+ sitesToAdd = removeDiveSites(sitesToRemove);
}
ImportDiveSites::ImportDiveSites(struct dive_site_table *sites, const QString &source)
@@ -124,12 +124,12 @@ bool ImportDiveSites::workToBeDone()
void ImportDiveSites::redo()
{
- sitesToRemove = std::move(addDiveSites(sitesToAdd));
+ sitesToRemove = addDiveSites(sitesToAdd);
}
void ImportDiveSites::undo()
{
- sitesToAdd = std::move(removeDiveSites(sitesToRemove));
+ sitesToAdd = removeDiveSites(sitesToRemove);
}
DeleteDiveSites::DeleteDiveSites(const QVector<dive_site *> &sites) : sitesToRemove(sites.toStdVector())
@@ -144,12 +144,12 @@ bool DeleteDiveSites::workToBeDone()
void DeleteDiveSites::redo()
{
- sitesToAdd = std::move(removeDiveSites(sitesToRemove));
+ sitesToAdd = removeDiveSites(sitesToRemove);
}
void DeleteDiveSites::undo()
{
- sitesToRemove = std::move(addDiveSites(sitesToAdd));
+ sitesToRemove = addDiveSites(sitesToAdd);
}
PurgeUnusedDiveSites::PurgeUnusedDiveSites()
@@ -169,12 +169,12 @@ bool PurgeUnusedDiveSites::workToBeDone()
void PurgeUnusedDiveSites::redo()
{
- sitesToAdd = std::move(removeDiveSites(sitesToRemove));
+ sitesToAdd = removeDiveSites(sitesToRemove);
}
void PurgeUnusedDiveSites::undo()
{
- sitesToRemove = std::move(addDiveSites(sitesToAdd));
+ sitesToRemove = addDiveSites(sitesToAdd);
}
// Helper function: swap C and Qt string
@@ -356,7 +356,7 @@ bool MergeDiveSites::workToBeDone()
void MergeDiveSites::redo()
{
// First, remove all dive sites
- sitesToAdd = std::move(removeDiveSites(sitesToRemove));
+ sitesToAdd = removeDiveSites(sitesToRemove);
// Remember which dives changed so that we can send a single dives-edited signal
QVector<dive *> divesChanged;
@@ -387,7 +387,7 @@ void MergeDiveSites::undo()
}
}
- sitesToRemove = std::move(addDiveSites(sitesToAdd));
+ sitesToRemove = addDiveSites(sitesToAdd);
emit diveListNotifier.divesChanged(divesChanged, DiveField::DIVESITE);
}