Block: convert an if into expression with ternary operator

This commit is contained in:
Andreas Schildbach 2023-08-09 00:51:36 +02:00
parent 4e91a274d9
commit f907a6b86f

View file

@ -206,9 +206,9 @@ public class Block extends BaseMessage {
this.time = time;
this.difficultyTarget = difficultyTarget;
this.nonce = nonce;
if (transactions != null)
transactions = new ArrayList<>(transactions);
this.transactions = transactions;
this.transactions = transactions != null ?
new ArrayList<>(transactions) :
null;
}
/**