Optimize torrentRow a bit

The problem is that torrentRow() does linear search over the list of all
available torrents. So it doesn't scale well for large number of
torrents. Removing the copying of QString from linear search
inner loop, speed up it considerably.

The proper solution should be using hash table instead of linear search.
This require more radical changes in TorrentModel and may be done in a
separate commit.
This commit is contained in:
Ivan Sorokin 2014-11-04 12:24:37 +03:00
parent 3202ad368f
commit 2e55c1f307

View File

@ -57,7 +57,7 @@ public:
inline int columnCount() const { return NB_COLUMNS; }
QVariant data(int column, int role = Qt::DisplayRole) const;
bool setData(int column, const QVariant &value, int role = Qt::DisplayRole);
inline QString hash() const { return m_hash; }
inline QString const& hash() const { return m_hash; }
State state() const;
signals: