From 240d1715c90a621a1ae599d34d1dfdbcc389f1f7 Mon Sep 17 00:00:00 2001 From: Moshe Kaplan Date: Thu, 3 Jul 2014 10:10:40 -0400 Subject: [PATCH] Minor performance enhancement `list.empty()` runs in constant time; `list.size` can run in linear time. `list.empty()` runs in constant time; `list.size` can run in linear time. Sources: http://www.cplusplus.com/reference/list/list/size/ http://www.cplusplus.com/reference/list/list/empty/ --- src/RageSoundPosMap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RageSoundPosMap.cpp b/src/RageSoundPosMap.cpp index 58eb7ff0d6..4bbbb8ab12 100644 --- a/src/RageSoundPosMap.cpp +++ b/src/RageSoundPosMap.cpp @@ -53,7 +53,7 @@ pos_map_queue &pos_map_queue::operator=( const pos_map_queue &rhs ) void pos_map_queue::Insert( int64_t iSourceFrame, int iFrames, int64_t iDestFrame, float fSourceToDestRatio ) { - if( m_pImpl->m_Queue.size() ) + if( !m_pImpl->m_Queue.empty() ) { /* Optimization: If the last entry lines up with this new entry, just merge them. */ pos_map_t &last = m_pImpl->m_Queue.back();