From 8eab0442f27d384fd136fe0d070a174d3903d92e Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Sat, 11 Oct 2014 19:23:06 +0100 Subject: [PATCH] Only run the loop until the condition changes --- src/libtomahawk/playlist/PlayableProxyModel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libtomahawk/playlist/PlayableProxyModel.cpp b/src/libtomahawk/playlist/PlayableProxyModel.cpp index 53cecb81d..2e9c551db 100644 --- a/src/libtomahawk/playlist/PlayableProxyModel.cpp +++ b/src/libtomahawk/playlist/PlayableProxyModel.cpp @@ -189,7 +189,7 @@ PlayableProxyModel::visibilityFilterAcceptsRow( int sourceRow, const QModelIndex return true; int items = 0; - for ( int i = 0; i < sourceRow; i++ ) + for ( int i = 0; ( i < sourceRow ) && ( items < m_maxVisibleItems ) ; i++ ) { if ( dupeFilterAcceptsRow( i, sourceParent ) && nameFilterAcceptsRow( i, sourceParent ) ) {