From fbe46959589a0b51df0584ffc83e1a1d7222a159 Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Fri, 27 Aug 2021 11:30:37 +0200 Subject: [PATCH] Slight optimization of GLGizmoSimplify::process(): Moved a static variable from inside a lambda outside as the static inner variable initialization & access has to be made thread safe. --- src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp b/src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp index d4e14c6f4..b9e5d111b 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoSimplify.cpp @@ -283,11 +283,11 @@ void GLGizmoSimplify::process() } }; - std::function statusfn = [this](int percent) { + int64_t last = 0; + std::function statusfn = [this, &last](int percent) { m_progress = percent; // check max 4fps - static int64_t last = 0; int64_t now = m_parent.timestamp_now(); if ((now - last) < 250) return; last = now;