[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [onionoo/master] Split up some non-trivial variable declarations.
commit 98cd5530f71132b0b23641a2be3d670e8307605a
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Mon Dec 8 10:10:28 2014 +0100
Split up some non-trivial variable declarations.
Suggested by iwakeh on #12651.
---
src/main/java/org/torproject/onionoo/docs/BandwidthStatus.java | 4 ++--
.../torproject/onionoo/updater/NodeDetailsStatusUpdater.java | 7 ++++---
.../org/torproject/onionoo/updater/WeightsStatusUpdater.java | 4 ++--
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/main/java/org/torproject/onionoo/docs/BandwidthStatus.java b/src/main/java/org/torproject/onionoo/docs/BandwidthStatus.java
index 8678028..c3b2db4 100644
--- a/src/main/java/org/torproject/onionoo/docs/BandwidthStatus.java
+++ b/src/main/java/org/torproject/onionoo/docs/BandwidthStatus.java
@@ -91,8 +91,8 @@ public class BandwidthStatus extends Document {
* DateTimeHelper.ONE_SECOND;
for (Map.Entry<Long, Long> e :
bandwidthHistory.getBandwidthValues().entrySet()) {
- long endMillis = e.getKey(),
- startMillis = endMillis - intervalMillis;
+ long endMillis = e.getKey();
+ long startMillis = endMillis - intervalMillis;
long bandwidthValue = e.getValue();
/* TODO Should we first check whether an interval is already
* contained in history? */
diff --git a/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java b/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java
index 5b879a6..935aa4e 100644
--- a/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java
+++ b/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java
@@ -234,7 +234,8 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
this.knownNodes.put(fingerprint, nodeStatus);
}
String address = entry.getAddress();
- int orPort = entry.getOrPort(), dirPort = entry.getDirPort();
+ int orPort = entry.getOrPort();
+ int dirPort = entry.getDirPort();
SortedSet<String> orAddressesAndPorts = new TreeSet<String>(
entry.getOrAddresses());
nodeStatus.addLastAddresses(validAfterMillis, address, orPort,
@@ -411,8 +412,8 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
if (this.knownNodes.containsKey(fingerprint)) {
updatedNodeStatus = this.knownNodes.get(fingerprint);
String address = nodeStatus.getAddress();
- int orPort = nodeStatus.getOrPort(),
- dirPort = nodeStatus.getDirPort();
+ int orPort = nodeStatus.getOrPort();
+ int dirPort = nodeStatus.getDirPort();
SortedSet<String> orAddressesAndPorts =
nodeStatus.getOrAddressesAndPorts();
updatedNodeStatus.addLastAddresses(
diff --git a/src/main/java/org/torproject/onionoo/updater/WeightsStatusUpdater.java b/src/main/java/org/torproject/onionoo/updater/WeightsStatusUpdater.java
index b6c3bd7..8b6f1a2 100644
--- a/src/main/java/org/torproject/onionoo/updater/WeightsStatusUpdater.java
+++ b/src/main/java/org/torproject/onionoo/updater/WeightsStatusUpdater.java
@@ -47,8 +47,8 @@ public class WeightsStatusUpdater implements DescriptorListener,
private void processRelayNetworkConsensus(
RelayNetworkStatusConsensus consensus) {
- long validAfterMillis = consensus.getValidAfterMillis(),
- freshUntilMillis = consensus.getFreshUntilMillis();
+ long validAfterMillis = consensus.getValidAfterMillis();
+ long freshUntilMillis = consensus.getFreshUntilMillis();
SortedMap<String, double[]> pathSelectionWeights =
this.calculatePathSelectionProbabilities(consensus);
this.updateWeightsHistory(validAfterMillis, freshUntilMillis,
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits