Skip to content

Commit c1b0bf8

Browse files
committed
perf(core): Improve ptr search
1 parent fe9f327 commit c1b0bf8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/sdk/schema.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,9 @@ void CSDKSchema::SetStateChanged(void* pEntity, uint64_t uHash)
195195
auto logger = g_ifaceService.FetchInterface<ILogger>(LOGGER_INTERFACE_VERSION);
196196

197197
auto uncheckedNetworkVar = reinterpret_cast<NetworkVar*>(pEntity);
198-
if (inlineNetworkVarVtbs.contains(uncheckedNetworkVar->pVtable())) {
199-
auto index = inlineNetworkVarVtbs[uncheckedNetworkVar->pVtable()];
198+
auto it = inlineNetworkVarVtbs.find(uncheckedNetworkVar->pVtable());
199+
if (it != inlineNetworkVarVtbs.end()) {
200+
auto index = it->second;
200201
uncheckedNetworkVar->StateChanged(index, NetworkStateChangedData(fieldInfo.m_uOffset));
201202
return;
202203
}

0 commit comments

Comments
 (0)