Browse Source

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.
adaptive-webui-19844
Ivan Sorokin 10 years ago
parent
commit
2e55c1f307
  1. 2
      src/qtlibtorrent/torrentmodel.h

2
src/qtlibtorrent/torrentmodel.h

@ -57,7 +57,7 @@ public: @@ -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:

Loading…
Cancel
Save