Skip to content

Commit a1136f0

Browse files
committed
Merge #12074: [qt] Optimizes boolean expression model && model->haveWatchOnly()
6dda059 [qt] Simplifies boolean expression model && model->haveWatchOnly() (251) Pull request description: This PR optimizes the boolean expression `model && model->haveWatchOnly()` to `model->haveWatchOnly()`. The boolean expression can be optimized because the method `TransactionView::exportClicked` already guards against a potential dereferenced null pointer by returning early if `model` is null. https://github.com/bitcoin/bitcoin/blob/63a4dc10876bfc61c2e87d35dcf17da2f0f8c316/src/qt/transactionview.cpp#L351-L353 Tree-SHA512: 8bdd0d05bf879745fa39d3ca7524471720ae08ceee9427d5a08776e7b56d18542ae87a6991cd6779e232305f504fdfc77223702b72ecbe231f5f5e98453456dd
2 parents c991b30 + 6dda059 commit a1136f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/qt/transactionview.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ void TransactionView::exportClicked()
365365
// name, column, role
366366
writer.setModel(transactionProxyModel);
367367
writer.addColumn(tr("Confirmed"), 0, TransactionTableModel::ConfirmedRole);
368-
if (model && model->haveWatchOnly())
368+
if (model->haveWatchOnly())
369369
writer.addColumn(tr("Watch-only"), TransactionTableModel::Watchonly);
370370
writer.addColumn(tr("Date"), 0, TransactionTableModel::DateRole);
371371
writer.addColumn(tr("Type"), TransactionTableModel::Type, Qt::EditRole);

0 commit comments

Comments
 (0)