Skip to content
Snippets Groups Projects
Commit f0c26115 authored by Armin Felder's avatar Armin Felder
Browse files

reserve

parent 6e6696dc
No related branches found
No related tags found
1 merge request!68Minor clean up
......@@ -2,7 +2,7 @@
EmojisModel::EmojisModel()
{
mDuplicateCheck.reserve( 2000 );
}
int EmojisModel::rowCount( const QModelIndex &parent ) const
......@@ -97,9 +97,10 @@ void EmojisModel::addEmojisByCategory( const QString &pCategory, const QList<QSh
if ( !mData.contains( pCategory ) ) {
mData.insert( pCategory, QList<QSharedPointer<Emoji>>() );
mData[pCategory].reserve( 600 );
}
for ( auto element : pList ) {
for ( const auto &element : pList ) {
if ( !mDuplicateCheck.contains( element->getIdentifier() ) ) {
mData[pCategory].append( element );
mDuplicateCheck.insert( element->getIdentifier() );
......
......@@ -26,7 +26,7 @@
MessagesModel::MessagesModel()
{
duplicateCheck.reserve( 10000 );
}
QVariant MessagesModel::data( const QModelIndex &index, int role ) const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment