[core] replace memcpy with assignment (#5280)

Also remove few unncessary uses of `this` pointer.
This commit is contained in:
Abtin Keshavarzian
2020-07-22 17:17:47 -07:00
committed by GitHub
parent bd197d3f47
commit 90db2d2ee7
4 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -252,7 +252,7 @@ otError otIp6SelectSourceAddress(otInstance *aInstance, otMessageInfo *aMessageI
netifAddr = instance.Get<Ip6::Ip6>().SelectSourceAddress(*static_cast<Ip6::MessageInfo *>(aMessageInfo));
VerifyOrExit(netifAddr != nullptr, error = OT_ERROR_NOT_FOUND);
memcpy(&aMessageInfo->mSockAddr, &netifAddr->mAddress, sizeof(aMessageInfo->mSockAddr));
aMessageInfo->mSockAddr = netifAddr->GetAddress();
exit:
return error;
+1 -1
View File
@@ -306,7 +306,7 @@ Message *Message::Clone(uint16_t aLength) const
VerifyOrExit(message != nullptr, OT_NOOP);
memcpy(&message->GetHelpData(), &GetHelpData(), sizeof(GetHelpData()));
message->GetHelpData() = GetHelpData();
exit:
return message;
+2 -2
View File
@@ -284,8 +284,8 @@ public:
*/
bool IsTokenEqual(const Message &aMessage) const
{
return ((this->GetTokenLength() == aMessage.GetTokenLength()) &&
(memcmp(this->GetToken(), aMessage.GetToken(), this->GetTokenLength()) == 0));
return ((GetTokenLength() == aMessage.GetTokenLength()) &&
(memcmp(GetToken(), aMessage.GetToken(), GetTokenLength()) == 0));
}
/**
+1 -1
View File
@@ -1522,7 +1522,7 @@ void Mle::HandleNotifierEvents(Events aEvents)
Get<BackboneRouter::Leader>().Update();
#endif
#if OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE
this->UpdateServiceAlocs();
UpdateServiceAlocs();
#endif
#if OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE