diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2020-10-26 10:04:53 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-10-26 19:27:03 -0700 |
commit | bbb55b29737f1a818e50de646ff8acadf7190c76 (patch) | |
tree | 0b4dcbcc8d842f9e1bdaec21c2f20336068a9eed /profile-widget/profilewidget2.cpp | |
parent | c463da3faceb5e9d94e2378148fc39194dc9b5f0 (diff) | |
download | subsurface-bbb55b29737f1a818e50de646ff8acadf7190c76.tar.gz |
cleanup: replace deprecated swap() usage
Instead of using the two different ways Qt supports swap, depending on the Qt
version in use, let's simply use std::swap()
Suggested-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile-widget/profilewidget2.cpp')
-rw-r--r-- | profile-widget/profilewidget2.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index 5b0bd8286..384826fe4 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -1822,12 +1822,12 @@ int ProfileWidget2::fixHandlerIndex(DiveHandler *activeHandler) if (index > 0 && index < handles.count() - 1) { DiveHandler *before = handles[index - 1]; if (before->pos().x() > activeHandler->pos().x()) { - handles.swap(index, index - 1); + std::swap(handles[index], handles[index - 1]); return index - 1; } DiveHandler *after = handles[index + 1]; if (after->pos().x() < activeHandler->pos().x()) { - handles.swap(index, index + 1); + std::swap(handles[index], handles[index + 1]); return index + 1; } } |