CLink: Collapse null checking

This commit is contained in:
Lioncache
2025-12-14 02:17:37 -05:00
parent 3f7eb16b54
commit 661a36f84a

View File

@@ -111,9 +111,7 @@ public:
uint32 SenderIndex() const uint32 SenderIndex() const
{ {
CScriptObject *pSender = mpArea->InstanceByID(mSenderID); if (const CScriptObject* pSender = mpArea->InstanceByID(mSenderID))
if (pSender)
{ {
for (uint32 iLink = 0; iLink < pSender->NumLinks(ELinkType::Outgoing); iLink++) for (uint32 iLink = 0; iLink < pSender->NumLinks(ELinkType::Outgoing); iLink++)
{ {
@@ -127,9 +125,7 @@ public:
uint32 ReceiverIndex() const uint32 ReceiverIndex() const
{ {
CScriptObject *pReceiver = mpArea->InstanceByID(mReceiverID); if (const CScriptObject* pReceiver = mpArea->InstanceByID(mReceiverID))
if (pReceiver)
{ {
for (uint32 iLink = 0; iLink < pReceiver->NumLinks(ELinkType::Incoming); iLink++) for (uint32 iLink = 0; iLink < pReceiver->NumLinks(ELinkType::Incoming); iLink++)
{ {