From f173b0a535e4d97c3ecd913eafb5e5c40aca2d44 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Sat, 18 Aug 2018 16:08:25 +0200 Subject: Avoid copy by passing shared_ptr<> with const reference. --- doc/book/net.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'doc') diff --git a/doc/book/net.tex b/doc/book/net.tex index 361733ed..301e3f11 100644 --- a/doc/book/net.tex +++ b/doc/book/net.tex @@ -360,7 +360,7 @@ class mySASLAuthenticator : public vmime::security::sasl::defaultSASLAuthenticat const std::vector > getAcceptableMechanisms (const std::vector >& available, - vmime::shared_ptr suggested) const + const vmime::shared_ptr & suggested) const { // Here, you can sort the SASL mechanisms in the order they will be // tried. If no SASL mechanism is acceptable (ie. for example, not @@ -372,7 +372,7 @@ class mySASLAuthenticator : public vmime::security::sasl::defaultSASLAuthenticat getAcceptableMechanisms(available, suggested); } - void setSASLMechanism(vmime::shared_ptr mech) + void setSASLMechanism(const vmime::shared_ptr & mech) { // This is called when the authentication process is going to // try the specified mechanism. @@ -982,7 +982,7 @@ class myCertVerifier : public vmime::security::cert::certificateVerifier { public: - void verify(vmime::shared_ptr certs) + void verify(const vmime::shared_ptr & certs) { // Obtain the subject's certificate vmime::shared_ptr cert = chain->getAt(0); @@ -1130,7 +1130,7 @@ class myTracerFactory : public vmime::net::tracerFactory public: vmime::shared_ptr create - (vmime::shared_ptr serv, + (const vmime::shared_ptr & serv, const int connectionId) { return vmime::make_shared -- cgit v1.2.3