It was copying callback which is unneccesary overhead.
Change-Id: Ic867a1e68225a95b2537737c9290ec0d3fe6354c
Signed-off-by: coderhyme <jhyo.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1516
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
const std::string&, OCConnectivityType, SubscribeCallback);
invokeOCFunc(static_cast<SubscribePresence>(OC::OCPlatform::subscribePresence),
const std::string&, OCConnectivityType, SubscribeCallback);
invokeOCFunc(static_cast<SubscribePresence>(OC::OCPlatform::subscribePresence),
- handle, host, connectivityType, presenceHandler);
+ handle, host, connectivityType, std::move(presenceHandler));
}
void subscribePresence(OCDoHandle& handle, const std::string& host,
}
void subscribePresence(OCDoHandle& handle, const std::string& host,
const std::string&, const std::string&, OCConnectivityType, SubscribeCallback);
invokeOCFunc(static_cast<SubscribePresence>(OC::OCPlatform::subscribePresence),
const std::string&, const std::string&, OCConnectivityType, SubscribeCallback);
invokeOCFunc(static_cast<SubscribePresence>(OC::OCPlatform::subscribePresence),
- handle, host, resourceType, connectivityType, presenceHandler);
+ handle, host, resourceType, connectivityType, std::move(presenceHandler));
}
void unsubscribePresence(OCDoHandle handle)
}
void unsubscribePresence(OCDoHandle handle)
OCConnectivityType connectivityType, SubscribeCallback presenceHandler) :
m_handle{ nullptr }
{
OCConnectivityType connectivityType, SubscribeCallback presenceHandler) :
m_handle{ nullptr }
{
- subscribePresence(m_handle, host, connectivityType, presenceHandler);
+ subscribePresence(m_handle, host, connectivityType, std::move(presenceHandler));
}
PresenceSubscriber::PresenceSubscriber(const std::string& host,
}
PresenceSubscriber::PresenceSubscriber(const std::string& host,
SubscribeCallback presenceHandler) :
m_handle{ nullptr }
{
SubscribeCallback presenceHandler) :
m_handle{ nullptr }
{
- subscribePresence(m_handle, host, resourceType, connectivityType, presenceHandler);
+ subscribePresence(m_handle, host, resourceType, connectivityType,
+ std::move(presenceHandler));
}
PresenceSubscriber::~PresenceSubscriber()
}
PresenceSubscriber::~PresenceSubscriber()