mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 15:07:22 -06:00
- Found a way not to use FullAllocationMode list in order to save memory in cpu
This commit is contained in:
@@ -131,7 +131,7 @@ size_type QTorrentHandle::actual_size() const{
|
||||
Q_ASSERT(h.is_valid());
|
||||
size_type size = 0;
|
||||
std::vector<int> piece_priorities = h.piece_priorities();
|
||||
for(unsigned int i = 0; i<piece_priorities.size(); ++i){
|
||||
for(unsigned int i = 0; i<piece_priorities.size(); ++i) {
|
||||
if(piece_priorities[i])
|
||||
size += h.get_torrent_info().piece_size(i);
|
||||
}
|
||||
@@ -139,6 +139,15 @@ size_type QTorrentHandle::actual_size() const{
|
||||
return size;
|
||||
}
|
||||
|
||||
bool QTorrentHandle::has_filtered_pieces() const {
|
||||
Q_ASSERT(h.is_valid());
|
||||
std::vector<int> piece_priorities = h.piece_priorities();
|
||||
for(unsigned int i = 0; i<piece_priorities.size(); ++i) {
|
||||
if(!piece_priorities[i]) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
int QTorrentHandle::download_limit() const {
|
||||
Q_ASSERT(h.is_valid());
|
||||
return h.download_limit();
|
||||
|
||||
Reference in New Issue
Block a user