mirror of
https://github.com/anthonyraymond/joal.git
synced 2024-09-20 07:16:26 +08:00
address review - remove default constructor from Speed
This commit is contained in:
parent
ac2ae03f21
commit
37e76707c4
|
@ -129,7 +129,7 @@ public class BandwidthDispatcher implements BandwidthDispatcherFacade, Runnable
|
|||
this.lock.writeLock().lock();
|
||||
try {
|
||||
this.torrentsSeedStats.put(infoHash, new TorrentSeedStats());
|
||||
this.speedMap.put(infoHash, new Speed());
|
||||
this.speedMap.put(infoHash, new Speed(0));
|
||||
} finally {
|
||||
this.lock.writeLock().unlock();
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ public class BandwidthDispatcher implements BandwidthDispatcherFacade, Runnable
|
|||
for (final InfoHash infohash : this.torrentsSeedStats.keySet()) {
|
||||
this.speedMap.compute(infohash, (hash, speed) -> {
|
||||
if (speed == null) {
|
||||
return new Speed();
|
||||
return new Speed(0);
|
||||
}
|
||||
double percentOfSpeedAssigned = this.weightHolder.getTotalWeight() == 0.0
|
||||
? 0.0
|
||||
|
|
|
@ -2,11 +2,9 @@ package org.araymond.joal.core.bandwith;
|
|||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Speed {
|
||||
private long bytesPerSecond;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue