From d849ac32f92f161f6bbaa2c146ac11101d63aa6e Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 26 Aug 2012 18:31:16 +0300 Subject: [PATCH] Make TorrentContentModel populating more efficient Step to improve issue #24. --- src/torrentcontentmodelfolder.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/torrentcontentmodelfolder.cpp b/src/torrentcontentmodelfolder.cpp index 0f33c5874..476ca27b7 100644 --- a/src/torrentcontentmodelfolder.cpp +++ b/src/torrentcontentmodelfolder.cpp @@ -70,14 +70,7 @@ const QList& TorrentContentModelFolder::children() con void TorrentContentModelFolder::appendChild(TorrentContentModelItem* item) { Q_ASSERT(item); - - int i=0; - for ( ; i < m_childItems.size(); ++i) { - QString newchild_name = item->name(); - if (QString::localeAwareCompare(newchild_name, m_childItems.at(i)->name()) < 0) - break; - } - m_childItems.insert(i, item); + m_childItems.append(item); } TorrentContentModelItem* TorrentContentModelFolder::child(int row) const