aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/ctfvisualizer/ctftracemanager.cpp
diff options
context:
space:
mode:
authorJarek Kobus <[email protected]>2020-12-08 15:41:46 +0100
committerJarek Kobus <[email protected]>2020-12-14 12:35:47 +0000
commitcf010911f7681b23aff6a150c50252374447addd (patch)
treef1774eac8d9b3a8c66a00fe3b73163507660d20d /src/plugins/ctfvisualizer/ctftracemanager.cpp
parent93dd966ce29720a295d01190f9b3f65e7d9043a8 (diff)
Don't allocate unneeded temporary containers
Fix clazy warnings: allocating an unneeded temporary container [clazy-container-anti-pattern] Change-Id: I4b4c2c634eea650bbdf3c12d982a17f899fc94ec Reviewed-by: Alessandro Portale <[email protected]> Reviewed-by: David Schulz <[email protected]> Reviewed-by: hjk <[email protected]>
Diffstat (limited to 'src/plugins/ctfvisualizer/ctftracemanager.cpp')
-rw-r--r--src/plugins/ctfvisualizer/ctftracemanager.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/ctfvisualizer/ctftracemanager.cpp b/src/plugins/ctfvisualizer/ctftracemanager.cpp
index ba0976dbec5..651e6c6f8e3 100644
--- a/src/plugins/ctfvisualizer/ctftracemanager.cpp
+++ b/src/plugins/ctfvisualizer/ctftracemanager.cpp
@@ -176,8 +176,9 @@ void CtfTraceManager::load(const QString &filename)
void CtfTraceManager::finalize()
{
bool userConsentToIgnoreDeepTraces = false;
- for (qint64 tid: m_threadModels.keys()) {
- if (m_threadModels[tid]->m_maxStackSize > 512) {
+ auto it = m_threadModels.begin();
+ while (it != m_threadModels.end()) {
+ if (it.value()->m_maxStackSize > 512) {
if (!userConsentToIgnoreDeepTraces) {
QMessageBox::StandardButton answer
= QMessageBox::question(Core::ICore::dialogParent(),
@@ -192,8 +193,10 @@ void CtfTraceManager::finalize()
break;
}
}
- m_threadModels.remove(tid);
- m_threadRestrictions.remove(tid);
+ m_threadRestrictions.remove(it.key());
+ it = m_threadModels.erase(it);
+ } else {
+ ++it;
}
}
for (CtfTimelineModel *model: m_threadModels) {