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
|
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);
|
assert(interface != nullptr);
|
||||||
return std::make_unique<sdbus::internal::Connection>(busType_, std::move(interface));
|
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()
|
std::unique_ptr<sdbus::IConnection> createSystemBusConnection()
|
||||||
{
|
{
|
||||||
auto interface = std::make_unique<SdBus>(SdBus());
|
auto interface = std::make_unique<SdBus>();
|
||||||
assert(interface != nullptr);
|
assert(interface != nullptr);
|
||||||
return std::make_unique<sdbus::internal::Connection>(sdbus::internal::Connection::BusType::eSystem,
|
return std::make_unique<sdbus::internal::Connection>(sdbus::internal::Connection::BusType::eSystem,
|
||||||
std::move(interface));
|
std::move(interface));
|
||||||
@ -374,7 +374,7 @@ std::unique_ptr<sdbus::IConnection> createSystemBusConnection(const std::string&
|
|||||||
|
|
||||||
std::unique_ptr<sdbus::IConnection> createSessionBusConnection()
|
std::unique_ptr<sdbus::IConnection> createSessionBusConnection()
|
||||||
{
|
{
|
||||||
auto interface = std::make_unique<SdBus>(SdBus());
|
auto interface = std::make_unique<SdBus>();
|
||||||
assert(interface != nullptr);
|
assert(interface != nullptr);
|
||||||
return std::make_unique<sdbus::internal::Connection>(sdbus::internal::Connection::BusType::eSession,
|
return std::make_unique<sdbus::internal::Connection>(sdbus::internal::Connection::BusType::eSession,
|
||||||
std::move(interface));
|
std::move(interface));
|
||||||
|
@ -89,7 +89,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
sdbus::internal::Connection AdaptorAndProxyFixture::m_connection{sdbus::internal::Connection::BusType::eSystem,
|
sdbus::internal::Connection AdaptorAndProxyFixture::m_connection{sdbus::internal::Connection::BusType::eSystem,
|
||||||
std::make_unique<SdBus>(SdBus())};
|
std::make_unique<SdBus>()};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user