mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-30 19:00:12 +02:00
Don't iterate over each result if we already know the required action early
This commit is contained in:
@@ -973,15 +973,15 @@ DropJob::removeRemoteSources()
|
||||
continue;
|
||||
}
|
||||
|
||||
bool hasLocalSource = false;
|
||||
foreach ( const Tomahawk::result_ptr& result, item->results() )
|
||||
{
|
||||
if ( !result->collection().isNull() && !result->collection()->source().isNull()
|
||||
&& result->collection()->source()->isLocal() )
|
||||
hasLocalSource = true;
|
||||
{
|
||||
list.append( item );
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( hasLocalSource )
|
||||
list.append( item );
|
||||
}
|
||||
m_resultList = list;
|
||||
}
|
||||
|
Reference in New Issue
Block a user