1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 14:16:32 +02:00

Directly return when we know the final value

This commit is contained in:
Uwe L. Korn
2014-10-12 15:38:43 +01:00
parent decd00318f
commit 4e845d3813

View File

@@ -263,17 +263,16 @@ PlayableProxyModel::nameFilterAcceptsRow( int sourceRow, PlayableItem* pi, const
{ {
QStringList sl = filterRegExp().pattern().split( " ", QString::SkipEmptyParts ); QStringList sl = filterRegExp().pattern().split( " ", QString::SkipEmptyParts );
bool found = true;
foreach( const QString& s, sl ) foreach( const QString& s, sl )
{ {
if ( !al->name().contains( s, Qt::CaseInsensitive ) && if ( !al->name().contains( s, Qt::CaseInsensitive ) &&
!al->artist()->name().contains( s, Qt::CaseInsensitive ) ) !al->artist()->name().contains( s, Qt::CaseInsensitive ) )
{ {
found = false; return false;
} }
} }
return found; return true;
} }
const Tomahawk::artist_ptr& ar = pi->artist(); const Tomahawk::artist_ptr& ar = pi->artist();
@@ -281,16 +280,15 @@ PlayableProxyModel::nameFilterAcceptsRow( int sourceRow, PlayableItem* pi, const
{ {
QStringList sl = filterRegExp().pattern().split( " ", QString::SkipEmptyParts ); QStringList sl = filterRegExp().pattern().split( " ", QString::SkipEmptyParts );
bool found = true;
foreach( const QString& s, sl ) foreach( const QString& s, sl )
{ {
if ( !ar->name().contains( s, Qt::CaseInsensitive ) ) if ( !ar->name().contains( s, Qt::CaseInsensitive ) )
{ {
found = false; return false;
} }
} }
return found; return true;
} }
return true; return true;