summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-12-22 03:17:30 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-12-22 03:17:30 -0600
commitd1b6b7be7d5bc7754a143b424295a267bbdafdbd (patch)
tree20ee69ce981cd5ba62c65bb35b21188cd7b83246 /src/tools
parentf4193c940cdc34284e19cf4cb0687c1a8e81a458 (diff)
downloadqt3-d1b6b7be7d5bc7754a143b424295a267bbdafdbd.tar.gz
qt3-d1b6b7be7d5bc7754a143b424295a267bbdafdbd.zip
Repair performance regression accidentally introduced with new style API
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/qvaluelist.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/tools/qvaluelist.h b/src/tools/qvaluelist.h
index 95dc7ff..b082097 100644
--- a/src/tools/qvaluelist.h
+++ b/src/tools/qvaluelist.h
@@ -250,6 +250,7 @@ public:
NodePtr find( NodePtr start, const T& x ) const;
int findIndex( NodePtr start, const T& x ) const;
uint contains( const T& x ) const;
+ bool containsYesNo( const T& x ) const;
uint remove( const T& x );
NodePtr at( size_type i ) const;
void clear();
@@ -355,6 +356,19 @@ Q_INLINE_TEMPLATES uint QValueListPrivate<T>::contains( const T& x ) const
}
template <class T>
+Q_INLINE_TEMPLATES bool QValueListPrivate<T>::containsYesNo( const T& x ) const
+{
+ Iterator first = Iterator( node->next );
+ Iterator last = Iterator( node );
+ while( first != last) {
+ if ( *first == x )
+ return true;
+ ++first;
+ }
+ return false;
+}
+
+template <class T>
Q_INLINE_TEMPLATES uint QValueListPrivate<T>::remove( const T& _x )
{
const T x = _x;
@@ -547,6 +561,7 @@ public:
const_iterator find ( const_iterator it, const T& x ) const { return const_iterator( sh->find( it.node, x ) ); }
int findIndex( const T& x ) const { return sh->findIndex( sh->node->next, x) ; }
size_type contains( const T& x ) const { return sh->contains( x ); }
+ bool containsYesNo( const T& x ) const { return sh->containsYesNo( x ); }
size_type count() const { return sh->nodes; }