From 534b679d63caa1018b8a9459655a97d07cb3f846 Mon Sep 17 00:00:00 2001 From: AdenKoperczak Date: Sun, 6 Oct 2024 12:19:54 -0400 Subject: [PATCH] Use std::vector::erase instead of self written code in remove_marker --- scwx-qt/source/scwx/qt/manager/marker_manager.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scwx-qt/source/scwx/qt/manager/marker_manager.cpp b/scwx-qt/source/scwx/qt/manager/marker_manager.cpp index 116f1c3b..e4cce9e6 100644 --- a/scwx-qt/source/scwx/qt/manager/marker_manager.cpp +++ b/scwx-qt/source/scwx/qt/manager/marker_manager.cpp @@ -229,12 +229,7 @@ void MarkerManager::remove_marker(size_t index) return; } - for (size_t i = index; i < p->markerRecords_.size() - 1; i++) - { - p->markerRecords_[i] = p->markerRecords_[i + 1]; - } - - p->markerRecords_.pop_back(); + p->markerRecords_.erase(std::next(p->markerRecords_.begin(), index)); Q_EMIT MarkerRemoved(index); Q_EMIT MarkersUpdated();