From e394a5fc71a14c6e384d6dc721338517e983d7d9 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" <uwelk@xhochy.com> Date: Thu, 21 Aug 2014 12:19:39 +0100 Subject: [PATCH] Remove reference to boost::ref As we bind the first argument, we only make a single copy of the shared pointer. This is a minimal performance difference that we should be able to afford in return for dropping Boost finally. --- src/libtomahawk/accounts/lastfm/LastFmConfig.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/libtomahawk/accounts/lastfm/LastFmConfig.cpp b/src/libtomahawk/accounts/lastfm/LastFmConfig.cpp index 31089a3ee..6b48e2b12 100644 --- a/src/libtomahawk/accounts/lastfm/LastFmConfig.cpp +++ b/src/libtomahawk/accounts/lastfm/LastFmConfig.cpp @@ -34,8 +34,6 @@ #include <lastfm/XmlQuery.h> #include <lastfm/Track.h> -#include <boost/ref.hpp> - using namespace Tomahawk::Accounts; @@ -337,7 +335,7 @@ LastFmConfig::onLovedFinished( QNetworkReply* reply ) bool -trackEquality( const Tomahawk::track_ptr& first, const Tomahawk::track_ptr& second ) +trackEquality( Tomahawk::track_ptr first, const Tomahawk::track_ptr& second ) { qDebug() << "Comparing:" << first->track() << second->track(); qDebug() << "==========" << first->artist() << second->artist(); @@ -367,7 +365,7 @@ LastFmConfig::syncLoved() foreach ( const Tomahawk::track_ptr& lastfmLoved, m_lastfmLoved ) { - QSet< Tomahawk::track_ptr >::const_iterator iter = std::find_if( myLoved.begin(), myLoved.end(), bind( &trackEquality, _1, boost::ref( lastfmLoved ) ) ); + QSet< Tomahawk::track_ptr >::const_iterator iter = std::find_if( myLoved.begin(), myLoved.end(), bind( &trackEquality, _1, lastfmLoved ) ); if ( iter == myLoved.constEnd() ) { // qDebug() << "Found last.fm loved track that we didn't have loved locally:" << lastfmLoved->track() << lastfmLoved->artist(); @@ -378,7 +376,7 @@ LastFmConfig::syncLoved() foreach ( const Tomahawk::track_ptr& localLoved, myLoved ) { qDebug() << "CHECKING FOR LOCAL LOVED ON LAST.FM TOO:" << m_localLoved[ localLoved ].value.toString() << localLoved->track() << localLoved->artist(); - QSet< Tomahawk::track_ptr >::const_iterator iter = std::find_if( m_lastfmLoved.begin(), m_lastfmLoved.end(), bind( &trackEquality, _1, boost::ref( localLoved ) ) ); + QSet< Tomahawk::track_ptr >::const_iterator iter = std::find_if( m_lastfmLoved.begin(), m_lastfmLoved.end(), bind( &trackEquality, _1, localLoved ) ); qDebug() << "Result:" << (iter == m_lastfmLoved.constEnd()); // If we unloved it locally, but it's still loved on last.fm, unlove it