diff options
author | David Robillard <d@drobilla.net> | 2020-08-01 14:42:16 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-08-02 01:48:48 +0200 |
commit | dbb38be5ccda387ef458583b5a85c03b59a5e05c (patch) | |
tree | ca6e767d1e7d6aa86efa992c14b6f1e967309aa5 /src/server | |
parent | cfee0cd7d2a704153df73449be38fcef60b958eb (diff) | |
download | ingen-dbb38be5ccda387ef458583b5a85c03b59a5e05c.tar.gz ingen-dbb38be5ccda387ef458583b5a85c03b59a5e05c.tar.bz2 ingen-dbb38be5ccda387ef458583b5a85c03b59a5e05c.zip |
Fix unnecessary parameter copies
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/Event.hpp | 19 | ||||
-rw-r--r-- | src/server/EventWriter.hpp | 2 | ||||
-rw-r--r-- | src/server/PortImpl.hpp | 6 | ||||
-rw-r--r-- | src/server/SocketServer.hpp | 6 |
4 files changed, 17 insertions, 16 deletions
diff --git a/src/server/Event.hpp b/src/server/Event.hpp index 9c284e49..a8d6979b 100644 --- a/src/server/Event.hpp +++ b/src/server/Event.hpp @@ -107,17 +107,14 @@ public: inline Engine& engine() { return _engine; } protected: - Event(Engine& engine, - const SPtr<Interface>& client, - int32_t id, - FrameTime time) - : _engine(engine) - , _next(nullptr) - , _request_client(std::move(client)) - , _request_id(id) - , _time(time) - , _status(Status::NOT_PREPARED) - , _mode(Mode::NORMAL) + Event(Engine& engine, SPtr<Interface> client, int32_t id, FrameTime time) + : _engine(engine) + , _next(nullptr) + , _request_client(std::move(client)) + , _request_id(id) + , _time(time) + , _status(Status::NOT_PREPARED) + , _mode(Mode::NORMAL) {} /** Constructor for internal events only */ diff --git a/src/server/EventWriter.hpp b/src/server/EventWriter.hpp index 85aa6f70..f0499f10 100644 --- a/src/server/EventWriter.hpp +++ b/src/server/EventWriter.hpp @@ -43,7 +43,7 @@ public: return _respondee; } - void set_respondee(SPtr<Interface> respondee) override { + void set_respondee(const SPtr<Interface>& respondee) override { _respondee = respondee; } diff --git a/src/server/PortImpl.hpp b/src/server/PortImpl.hpp index 86e98661..fba24f06 100644 --- a/src/server/PortImpl.hpp +++ b/src/server/PortImpl.hpp @@ -233,7 +233,11 @@ public: BufferRef value_buffer(uint32_t voice) const; BufferRef user_buffer(RunContext&) const { return _user_buffer; } - void set_user_buffer(RunContext&, BufferRef b) { _user_buffer = b; } + + void set_user_buffer(RunContext&, BufferRef b) + { + _user_buffer = std::move(b); + } /** Return offset of the first value change after `offset`. */ virtual SampleCount next_value_offset(SampleCount offset, diff --git a/src/server/SocketServer.hpp b/src/server/SocketServer.hpp index f3f02a26..cd5afb25 100644 --- a/src/server/SocketServer.hpp +++ b/src/server/SocketServer.hpp @@ -36,9 +36,9 @@ namespace server { class SocketServer { public: - SocketServer(World& world, - server::Engine& engine, - SPtr<Raul::Socket> sock) + SocketServer(World& world, + server::Engine& engine, + const SPtr<Raul::Socket>& sock) : _engine(engine) , _sink(world.conf().option("dump").get<int32_t>() ? SPtr<Interface>( |