Skip to content

Commit

Permalink
Merge #10964: Pass SendCoinsRecipient (208 bytes) by reference
Browse files Browse the repository at this point in the history
d3d946a Pass SendCoinsRecipient (208 bytes) by const reference (practicalswift)

Pull request description:

  Pass `SendCoinsRecipient` (208 bytes) by reference.

  Avoid passing big parameters by value.

Tree-SHA512: 504791f1b1c73badbc276db13b83e39695298d7d82a9db0e48d54e7ef02f1a8d276b0adfdece1ba1130cc214e2f0fa9a3100b5359d0ca0fe96558d3c9a786e6e
  • Loading branch information
jonasschnelli committed Aug 15, 2017
2 parents 3841aaf + d3d946a commit 64e66bb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/qt/paymentserver.cpp
Expand Up @@ -620,7 +620,7 @@ void PaymentServer::fetchRequest(const QUrl& url)
netManager->get(netRequest);
}

void PaymentServer::fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipient, QByteArray transaction)
void PaymentServer::fetchPaymentACK(CWallet* wallet, const SendCoinsRecipient& recipient, QByteArray transaction)
{
const payments::PaymentDetails& details = recipient.paymentRequest.getDetails();
if (!details.has_payment_url())
Expand Down
2 changes: 1 addition & 1 deletion src/qt/paymentserver.h
Expand Up @@ -113,7 +113,7 @@ public Q_SLOTS:
void uiReady();

// Submit Payment message to a merchant, get back PaymentACK:
void fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipient, QByteArray transaction);
void fetchPaymentACK(CWallet* wallet, const SendCoinsRecipient& recipient, QByteArray transaction);

// Handle an incoming URI, URI with local file scheme or file
void handleURIOrFile(const QString& s);
Expand Down
2 changes: 1 addition & 1 deletion src/qt/test/paymentservertests.cpp
Expand Up @@ -205,7 +205,7 @@ void PaymentServerTests::paymentServerTests()
delete server;
}

void RecipientCatcher::getRecipient(SendCoinsRecipient r)
void RecipientCatcher::getRecipient(const SendCoinsRecipient& r)
{
recipient = r;
}
2 changes: 1 addition & 1 deletion src/qt/test/paymentservertests.h
Expand Up @@ -26,7 +26,7 @@ class RecipientCatcher : public QObject
Q_OBJECT

public Q_SLOTS:
void getRecipient(SendCoinsRecipient r);
void getRecipient(const SendCoinsRecipient& r);

public:
SendCoinsRecipient recipient;
Expand Down

0 comments on commit 64e66bb

Please sign in to comment.