mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 12:28:52 +00:00
add tr_sessionGetTorrents(), a private utility to avoid code duplication in libtransmission
This commit is contained in:
@@ -181,11 +181,7 @@ getTorrents (tr_session * session,
|
||||
}
|
||||
else /* all of them */
|
||||
{
|
||||
tr_torrent * tor = NULL;
|
||||
const int n = tr_sessionCountTorrents (session);
|
||||
torrents = tr_new0 (tr_torrent *, n);
|
||||
while ((tor = tr_torrentNext (session, tor)))
|
||||
torrents[torrentCount++] = tor;
|
||||
torrents = tr_sessionGetTorrents (session, &torrentCount);
|
||||
}
|
||||
|
||||
*setmeCount = torrentCount;
|
||||
|
||||
Reference in New Issue
Block a user