Skip to content

Commit fcf5f30

Browse files
committed
fix warning about pair copy creation in for-loop
1 parent 8881e46 commit fcf5f30

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Sofa/framework/Simulation/Core/src/sofa/simulation/task/WorkerThread.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,15 +245,15 @@ bool WorkerThread::addTask(Task *task)
245245

246246
bool WorkerThread::stealTask(Task **task)
247247
{
248-
for (const auto it : m_taskScheduler->_threads)
248+
for (const auto& [id, otherThread] : m_taskScheduler->_threads)
249249
{
250250
// if this is the main thread continue
251-
if (std::this_thread::get_id() == it.first)
251+
if (std::this_thread::get_id() == id)
252252
{
253253
continue;
254254
}
255255

256-
WorkerThread *otherThread = it.second;
256+
//WorkerThread *otherThread = it.second;
257257
{
258258
simulation::ScopedLock lock(otherThread->m_taskMutex);
259259
if (!otherThread->m_tasks.empty())

0 commit comments

Comments
 (0)