1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-25 21:42:07 +01:00

Minor code improvements in DNSutil

This commit is contained in:
Florian Schmaus 2017-01-06 14:49:12 +01:00
parent b343b499b5
commit 24bbe63da1

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) {