mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-01 03:40:16 +02:00
* Unspectacular performance improvement.
This commit is contained in:
@@ -48,20 +48,21 @@ DatabaseCommand_ArtistStats::exec( DatabaseImpl* dbi )
|
|||||||
unsigned int plays = 0;
|
unsigned int plays = 0;
|
||||||
unsigned int chartPos = 0;
|
unsigned int chartPos = 0;
|
||||||
unsigned int chartCount = 0;
|
unsigned int chartCount = 0;
|
||||||
|
const unsigned int artistId = m_artist->id();
|
||||||
|
|
||||||
QHash< QString, unsigned int > charts;
|
QHash< QString, unsigned int > charts;
|
||||||
while ( query.next() )
|
while ( query.next() )
|
||||||
{
|
{
|
||||||
chartCount++;
|
chartCount++;
|
||||||
|
|
||||||
if ( query.value( 1 ).toUInt() == m_artist->id() )
|
if ( chartPos == 0 && query.value( 1 ).toUInt() == artistId )
|
||||||
{
|
{
|
||||||
chartPos = chartCount;
|
chartPos = chartCount;
|
||||||
plays = query.value( 0 ).toUInt();
|
plays = query.value( 0 ).toUInt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( plays == 0 )
|
if ( chartPos == 0 )
|
||||||
chartPos = chartCount;
|
chartPos = chartCount;
|
||||||
|
|
||||||
emit done( plays, chartPos, chartCount );
|
emit done( plays, chartPos, chartCount );
|
||||||
|
Reference in New Issue
Block a user