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