Skip to content

Commit

Permalink
Reduce conditionals in DnsNameResovlerContext
Browse files Browse the repository at this point in the history
Motivation:
Minor cleanup from 844d804 just to reduce the conditional statements and indentation level.

Modifications:
- combine the else + if into an else if statement

Result:
Code cleaned up.
  • Loading branch information
Scottmitch committed Nov 20, 2017
1 parent 93b144b commit 907ed79
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,10 @@ public void operationComplete(Future<T> future) throws Exception {
promise.trySuccess(future.getNow());
} else if (searchDomainIdx < searchDomains.length) {
doSearchDomainQuery(hostname + '.' + searchDomains[searchDomainIdx++], this);
} else if (!startWithoutSearchDomain) {
internalResolve(promise);
} else {
if (!startWithoutSearchDomain) {
internalResolve(promise);
} else {
promise.tryFailure(new SearchDomainUnknownHostException(future.cause(), hostname));
}
promise.tryFailure(new SearchDomainUnknownHostException(future.cause(), hostname));
}
}
});
Expand Down

0 comments on commit 907ed79

Please sign in to comment.