[refactor] use lambda.

This commit is contained in:
gubatron 2016-01-14 17:07:49 -05:00
parent 088334014c
commit c899466ec4

View file

@ -49,9 +49,7 @@ class AddressBasedCoinSelector implements CoinSelector {
@VisibleForTesting
static void sortOutputs(ArrayList<TransactionOutput> outputs) {
Collections.sort(outputs, new Comparator<TransactionOutput>() {
@Override
public int compare(TransactionOutput a, TransactionOutput b) {
Collections.sort(outputs, (a, b) -> {
int depth1 = a.getParentTransactionDepthInBlocks();
int depth2 = b.getParentTransactionDepthInBlocks();
Coin aValue = a.getValue();
@ -69,7 +67,6 @@ class AddressBasedCoinSelector implements CoinSelector {
BigInteger aHash = a.getParentTransactionHash().toBigInteger();
BigInteger bHash = b.getParentTransactionHash().toBigInteger();
return aHash.compareTo(bHash);
}
});
}