Remove unnecessary copy-construction when making SdBus

This commit is contained in:
sangelovic
2019-03-18 21:28:17 +01:00
parent 850e211dca
commit b9ce1ca3ce
2 changed files with 4 additions and 4 deletions

View File

@ -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));

View File

@ -89,7 +89,7 @@ public:
};
sdbus::internal::Connection AdaptorAndProxyFixture::m_connection{sdbus::internal::Connection::BusType::eSystem,
std::make_unique<SdBus>(SdBus())};
std::make_unique<SdBus>()};
}