forked from Kistler-Group/sdbus-cpp
Remove unnecessary copy-construction when making SdBus
This commit is contained in:
@@ -188,7 +188,7 @@ void Connection::sendReplyAsynchronously(const sdbus::MethodReply& reply)
|
||||
|
||||
std::unique_ptr<sdbus::internal::IConnection> Connection::clone() const
|
||||
{
|
||||
auto interface = std::make_unique<SdBus>(SdBus());
|
||||
auto interface = std::make_unique<SdBus>();
|
||||
assert(interface != nullptr);
|
||||
return std::make_unique<sdbus::internal::Connection>(busType_, std::move(interface));
|
||||
}
|
||||
@@ -359,7 +359,7 @@ std::unique_ptr<sdbus::IConnection> createConnection(const std::string& name)
|
||||
|
||||
std::unique_ptr<sdbus::IConnection> createSystemBusConnection()
|
||||
{
|
||||
auto interface = std::make_unique<SdBus>(SdBus());
|
||||
auto interface = std::make_unique<SdBus>();
|
||||
assert(interface != nullptr);
|
||||
return std::make_unique<sdbus::internal::Connection>(sdbus::internal::Connection::BusType::eSystem,
|
||||
std::move(interface));
|
||||
@@ -374,7 +374,7 @@ std::unique_ptr<sdbus::IConnection> createSystemBusConnection(const std::string&
|
||||
|
||||
std::unique_ptr<sdbus::IConnection> createSessionBusConnection()
|
||||
{
|
||||
auto interface = std::make_unique<SdBus>(SdBus());
|
||||
auto interface = std::make_unique<SdBus>();
|
||||
assert(interface != nullptr);
|
||||
return std::make_unique<sdbus::internal::Connection>(sdbus::internal::Connection::BusType::eSession,
|
||||
std::move(interface));
|
||||
|
||||
Reference in New Issue
Block a user