mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-03-10 09:20:04 +01:00
TransactionInput: convert an if-else into expression with ternary operator
This commit is contained in:
parent
2b68d8da8e
commit
0a58d0a5c3
1 changed files with 3 additions and 6 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue