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.
This commit is contained in:
Vojtech Bubnik 2021-08-27 11:30:37 +02:00
parent ae8e0311d7
commit fbe4695958

View File

@ -283,11 +283,11 @@ void GLGizmoSimplify::process()
}
};
std::function<void(int)> statusfn = [this](int percent) {
int64_t last = 0;
std::function<void(int)> 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;