Minor code improvements in DNSutil

This commit is contained in:
Florian Schmaus 2017-01-06 14:49:12 +01:00
parent b343b499b5
commit 24bbe63da1
1 changed files with 4 additions and 2 deletions

View File

@ -250,14 +250,16 @@ public class DNSUtil {
List<SRVRecord> bucket = buckets.get(priority); List<SRVRecord> bucket = buckets.get(priority);
int bucketSize; int bucketSize;
while ((bucketSize = bucket.size()) > 0) { while ((bucketSize = bucket.size()) > 0) {
int[] totals = new int[bucket.size()]; int[] totals = new int[bucketSize];
int running_total = 0; int running_total = 0;
int count = 0; int count = 0;
int zeroWeight = 1; int zeroWeight = 1;
for (SRVRecord r : bucket) { for (SRVRecord r : bucket) {
if (r.getWeight() > 0) if (r.getWeight() > 0) {
zeroWeight = 0; zeroWeight = 0;
break;
}
} }
for (SRVRecord r : bucket) { for (SRVRecord r : bucket) {