address review - remove default constructor from Speed

This commit is contained in:
laur 2022-11-02 19:54:09 +01:00
parent ac2ae03f21
commit 37e76707c4
2 changed files with 2 additions and 4 deletions

View file

@ -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

View file

@ -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;
}