From 661a36f84a7e6dd11b79a2b7a724e18ac5fdafe4 Mon Sep 17 00:00:00 2001 From: Lioncache Date: Sun, 14 Dec 2025 02:17:37 -0500 Subject: [PATCH] CLink: Collapse null checking --- src/Core/Resource/Script/CLink.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Core/Resource/Script/CLink.h b/src/Core/Resource/Script/CLink.h index b3b40e7c..a3aa17d4 100644 --- a/src/Core/Resource/Script/CLink.h +++ b/src/Core/Resource/Script/CLink.h @@ -111,9 +111,7 @@ public: uint32 SenderIndex() const { - CScriptObject *pSender = mpArea->InstanceByID(mSenderID); - - if (pSender) + if (const CScriptObject* pSender = mpArea->InstanceByID(mSenderID)) { for (uint32 iLink = 0; iLink < pSender->NumLinks(ELinkType::Outgoing); iLink++) { @@ -127,9 +125,7 @@ public: uint32 ReceiverIndex() const { - CScriptObject *pReceiver = mpArea->InstanceByID(mReceiverID); - - if (pReceiver) + if (const CScriptObject* pReceiver = mpArea->InstanceByID(mReceiverID)) { for (uint32 iLink = 0; iLink < pReceiver->NumLinks(ELinkType::Incoming); iLink++) {