1
0
Fork 0

DBG: Small ThreadExit optimization

This commit is contained in:
Nukem 2015-07-10 01:25:14 -04:00
parent 45bb20f297
commit 529e5f1e3a
1 changed files with 5 additions and 9 deletions

View File

@ -38,15 +38,11 @@ void ThreadExit(DWORD ThreadId)
{
EXCLUSIVE_ACQUIRE(LockThreads);
// Don't use a foreach loop here because of the iterator erase() call
for(auto itr = threadList.begin(); itr != threadList.end(); itr++)
{
if(itr->first == ThreadId)
{
threadList.erase(itr);
break;
}
}
// Erase element using native functions
auto itr = threadList.find(ThreadId);
if(itr != threadList.end())
threadList.erase(itr);
EXCLUSIVE_RELEASE();
GuiUpdateThreadView();