diff options
author | louiz’ <louiz@louiz.org> | 2017-03-08 19:04:15 +0100 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2017-03-08 19:04:15 +0100 |
commit | f0bc6c83a8eb548d0a3edbf7c16a6922bfd24ba5 (patch) | |
tree | c9df36ef6781dfa56d2a3fee5b68390aa1e9ceb5 /src | |
parent | cd92baae3f0de8b841b5bbfdb02e4fa95acd52c1 (diff) | |
download | biboumi-f0bc6c83a8eb548d0a3edbf7c16a6922bfd24ba5.tar.gz biboumi-f0bc6c83a8eb548d0a3edbf7c16a6922bfd24ba5.tar.bz2 biboumi-f0bc6c83a8eb548d0a3edbf7c16a6922bfd24ba5.tar.xz biboumi-f0bc6c83a8eb548d0a3edbf7c16a6922bfd24ba5.zip |
Pass the shared_ptr by reference, to avoid useless copies
Diffstat (limited to 'src')
-rw-r--r-- | src/bridge/bridge.cpp | 2 | ||||
-rw-r--r-- | src/bridge/bridge.hpp | 2 | ||||
-rw-r--r-- | src/identd/identd_server.hpp | 2 | ||||
-rw-r--r-- | src/identd/identd_socket.cpp | 2 | ||||
-rw-r--r-- | src/identd/identd_socket.hpp | 2 | ||||
-rw-r--r-- | src/irc/irc_client.cpp | 2 | ||||
-rw-r--r-- | src/irc/irc_client.hpp | 2 | ||||
-rw-r--r-- | src/xmpp/biboumi_component.cpp | 2 | ||||
-rw-r--r-- | src/xmpp/biboumi_component.hpp | 2 |
9 files changed, 9 insertions, 9 deletions
diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp index 573e8d7..7e2d8c1 100644 --- a/src/bridge/bridge.cpp +++ b/src/bridge/bridge.cpp @@ -29,7 +29,7 @@ static std::string in_encoding_for(const Bridge& bridge, const Iid& iid) #endif } -Bridge::Bridge(const std::string& user_jid, BiboumiComponent& xmpp, std::shared_ptr<Poller> poller): +Bridge::Bridge(const std::string& user_jid, BiboumiComponent& xmpp, std::shared_ptr<Poller>& poller): user_jid(user_jid), xmpp(xmpp), poller(poller) diff --git a/src/bridge/bridge.hpp b/src/bridge/bridge.hpp index b165650..73daae7 100644 --- a/src/bridge/bridge.hpp +++ b/src/bridge/bridge.hpp @@ -38,7 +38,7 @@ using irc_responder_callback_t = std::function<bool(const std::string& irc_hostn class Bridge { public: - explicit Bridge(const std::string& user_jid, BiboumiComponent& xmpp, std::shared_ptr<Poller> poller); + explicit Bridge(const std::string& user_jid, BiboumiComponent& xmpp, std::shared_ptr<Poller>& poller); ~Bridge() = default; Bridge(const Bridge&) = delete; diff --git a/src/identd/identd_server.hpp b/src/identd/identd_server.hpp index 5f74976..b1c8ec8 100644 --- a/src/identd/identd_server.hpp +++ b/src/identd/identd_server.hpp @@ -10,7 +10,7 @@ class BiboumiComponent; class IdentdServer: public TcpSocketServer<IdentdSocket> { public: - IdentdServer(const BiboumiComponent& biboumi_component, std::shared_ptr<Poller> poller, const uint16_t port): + IdentdServer(const BiboumiComponent& biboumi_component, std::shared_ptr<Poller>& poller, const uint16_t port): TcpSocketServer<IdentdSocket>(poller, port), biboumi_component(biboumi_component) {} diff --git a/src/identd/identd_socket.cpp b/src/identd/identd_socket.cpp index a94f172..b85257c 100644 --- a/src/identd/identd_socket.cpp +++ b/src/identd/identd_socket.cpp @@ -8,7 +8,7 @@ #include <logger/logger.hpp> -IdentdSocket::IdentdSocket(std::shared_ptr<Poller> poller, const socket_t socket, TcpSocketServer<IdentdSocket>& server): +IdentdSocket::IdentdSocket(std::shared_ptr<Poller>& poller, const socket_t socket, TcpSocketServer<IdentdSocket>& server): TCPSocketHandler(poller), server(dynamic_cast<IdentdServer&>(server)) { diff --git a/src/identd/identd_socket.hpp b/src/identd/identd_socket.hpp index 1c2bd27..10cb797 100644 --- a/src/identd/identd_socket.hpp +++ b/src/identd/identd_socket.hpp @@ -17,7 +17,7 @@ class TcpSocketServer; class IdentdSocket: public TCPSocketHandler { public: - IdentdSocket(std::shared_ptr<Poller> poller, const socket_t socket, TcpSocketServer<IdentdSocket>& server); + IdentdSocket(std::shared_ptr<Poller>& poller, const socket_t socket, TcpSocketServer<IdentdSocket>& server); ~IdentdSocket() = default; std::string generate_answer(const BiboumiComponent& biboumi, uint16_t local, uint16_t remote); diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp index 6813bba..d0970c1 100644 --- a/src/irc/irc_client.cpp +++ b/src/irc/irc_client.cpp @@ -128,7 +128,7 @@ static const std::unordered_map<std::string, {"502", {&IrcClient::on_generic_error, {2, 0}}}, }; -IrcClient::IrcClient(std::shared_ptr<Poller> poller, const std::string& hostname, +IrcClient::IrcClient(std::shared_ptr<Poller>& poller, const std::string& hostname, const std::string& nickname, const std::string& username, const std::string& realname, const std::string& user_hostname, Bridge& bridge): diff --git a/src/irc/irc_client.hpp b/src/irc/irc_client.hpp index 4b942ad..009d0c9 100644 --- a/src/irc/irc_client.hpp +++ b/src/irc/irc_client.hpp @@ -26,7 +26,7 @@ class Bridge; class IrcClient: public TCPClientSocketHandler { public: - explicit IrcClient(std::shared_ptr<Poller> poller, const std::string& hostname, + explicit IrcClient(std::shared_ptr<Poller>& poller, const std::string& hostname, const std::string& nickname, const std::string& username, const std::string& realname, const std::string& user_hostname, Bridge& bridge); diff --git a/src/xmpp/biboumi_component.cpp b/src/xmpp/biboumi_component.cpp index 2783b93..4ba5e65 100644 --- a/src/xmpp/biboumi_component.cpp +++ b/src/xmpp/biboumi_component.cpp @@ -44,7 +44,7 @@ static std::set<std::string> kickable_errors{ }; -BiboumiComponent::BiboumiComponent(std::shared_ptr<Poller> poller, const std::string& hostname, const std::string& secret): +BiboumiComponent::BiboumiComponent(std::shared_ptr<Poller>& poller, const std::string& hostname, const std::string& secret): XmppComponent(poller, hostname, secret), irc_server_adhoc_commands_handler(*this), irc_channel_adhoc_commands_handler(*this) diff --git a/src/xmpp/biboumi_component.hpp b/src/xmpp/biboumi_component.hpp index aa0c3db..1d25e0e 100644 --- a/src/xmpp/biboumi_component.hpp +++ b/src/xmpp/biboumi_component.hpp @@ -27,7 +27,7 @@ using iq_responder_callback_t = std::function<void(Bridge* bridge, const Stanza& class BiboumiComponent: public XmppComponent { public: - explicit BiboumiComponent(std::shared_ptr<Poller> poller, const std::string& hostname, const std::string& secret); + explicit BiboumiComponent(std::shared_ptr<Poller>& poller, const std::string& hostname, const std::string& secret); ~BiboumiComponent() = default; BiboumiComponent(const BiboumiComponent&) = delete; |