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>
This commit is contained in:
Dirk Hohndel 2020-10-26 10:04:53 -07:00
parent c463da3fac
commit bbb55b2973

View file

@ -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;
}
}