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) {
|
TransactionInput(Transaction parentTransaction, TransactionOutput output) {
|
||||||
super();
|
super();
|
||||||
long outputIndex = output.getIndex();
|
outpoint = output.getParentTransaction() != null ?
|
||||||
if(output.getParentTransaction() != null ) {
|
new TransactionOutPoint(output.getIndex(), output.getParentTransaction()) :
|
||||||
outpoint = new TransactionOutPoint(outputIndex, output.getParentTransaction());
|
new TransactionOutPoint(output);
|
||||||
} else {
|
|
||||||
outpoint = new TransactionOutPoint(output);
|
|
||||||
}
|
|
||||||
scriptBytes = EMPTY_ARRAY;
|
scriptBytes = EMPTY_ARRAY;
|
||||||
sequence = NO_SEQUENCE;
|
sequence = NO_SEQUENCE;
|
||||||
setParent(parentTransaction);
|
setParent(parentTransaction);
|
||||||
|
|
Loading…
Add table
Reference in a new issue