mirror of https://github.com/aria2/aria2
2006-11-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/DefaultPeerStorage.cc (calculateStat): Simplified the code by combining 2 loops into 1.pull/1/head
parent
b14e4a5ac1
commit
c2686b1c50
|
@ -1,3 +1,8 @@
|
|||
2006-11-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
* src/DefaultPeerStorage.cc
|
||||
(calculateStat): Simplified the code by combining 2 loops into 1.
|
||||
|
||||
2006-11-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
Introduce new preference PREF_BT_TIMEOUT. This is the timeout value
|
||||
|
|
|
@ -150,15 +150,12 @@ Peers DefaultPeerStorage::getActivePeers() {
|
|||
|
||||
TransferStat DefaultPeerStorage::calculateStat() {
|
||||
TransferStat stat;
|
||||
Peers activePeers = getActivePeers();
|
||||
for(Peers::iterator itr = activePeers.begin();
|
||||
itr != activePeers.end(); itr++) {
|
||||
PeerHandle& peer = *itr;
|
||||
stat.downloadSpeed += peer->calculateDownloadSpeed();
|
||||
stat.uploadSpeed += peer->calculateUploadSpeed();
|
||||
}
|
||||
for(Peers::iterator itr = peers.begin(); itr != peers.end(); itr++) {
|
||||
PeerHandle& peer = *itr;
|
||||
if(peer->isActive()) {
|
||||
stat.downloadSpeed += peer->calculateDownloadSpeed();
|
||||
stat.uploadSpeed += peer->calculateUploadSpeed();
|
||||
}
|
||||
stat.sessionDownloadLength += peer->getSessionDownloadLength();
|
||||
stat.sessionUploadLength += peer->getSessionUploadLength();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue