From eabcbf0632cc8a1f83ebfc237fbeae788e0e1822 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Sun, 16 Nov 2014 11:11:45 +0100 Subject: [PATCH] Don't iterate over each result if we already know the required action early --- src/libtomahawk/DropJob.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libtomahawk/DropJob.cpp b/src/libtomahawk/DropJob.cpp index e42f0cc7c..f27edca25 100644 --- a/src/libtomahawk/DropJob.cpp +++ b/src/libtomahawk/DropJob.cpp @@ -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; }