TransactionInput: convert an if-else into expression with ternary operator

This commit is contained in:
Andreas Schildbach 2023-08-08 11:54:34 +02:00
parent 2b68d8da8e
commit 0a58d0a5c3

View file

@ -143,12 +143,9 @@ public class TransactionInput {
*/
TransactionInput(Transaction parentTransaction, TransactionOutput output) {
super();
long outputIndex = output.getIndex();
if(output.getParentTransaction() != null ) {
outpoint = new TransactionOutPoint(outputIndex, output.getParentTransaction());
} else {
outpoint = new TransactionOutPoint(output);
}
outpoint = output.getParentTransaction() != null ?
new TransactionOutPoint(output.getIndex(), output.getParentTransaction()) :
new TransactionOutPoint(output);
scriptBytes = EMPTY_ARRAY;
sequence = NO_SEQUENCE;
setParent(parentTransaction);