Condense code.

This commit is contained in:
Bartosz Taudul 2017-10-28 13:19:32 +02:00
parent a2a314678b
commit 09c9502061

View File

@ -2203,14 +2203,7 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos,
{
if( (*vbegin)->lockingThread == thread )
{
if( !AreOtherWaiting( (*vbegin)->waitList, thread ) )
{
state = State::HasLock;
}
else
{
state = State::HasBlockingLock;
}
state = AreOtherWaiting( (*vbegin)->waitList, thread ) ? State::HasBlockingLock : State::HasLock;
}
else if( IsThreadWaiting( (*vbegin)->waitList, thread ) )
{
@ -2233,17 +2226,9 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos,
{
if( (*next)->lockingThread == thread )
{
if( !AreOtherWaiting( (*next)->waitList, thread ) )
{
nextState = State::HasLock;
nextState = AreOtherWaiting( (*next)->waitList, thread ) ? State::HasBlockingLock : State::HasLock;
break;
}
else
{
nextState = State::HasBlockingLock;
break;
}
}
else if( IsThreadWaiting( (*next)->waitList, thread ) )
{
nextState = State::WaitLock;
@ -2299,17 +2284,9 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos,
{
if( (*next)->lockingThread == thread )
{
if( !AreOtherWaiting( (*next)->waitList, thread ) )
{
nextState = State::HasLock;
nextState = AreOtherWaiting( (*next)->waitList, thread ) ? State::HasBlockingLock : State::HasLock;
break;
}
else
{
nextState = State::HasBlockingLock;
break;
}
}
if( (*next)->lockingThread != (*vbegin)->lockingThread )
{
break;