Break early in peer matching

This commit is contained in:
ChillerDragon 2024-10-04 14:46:33 +08:00
parent e8798a9e2f
commit 11047d1b80

View file

@ -362,7 +362,11 @@ int CNetConnection::Feed(CNetPacketConstruct *pPacket, NETADDR *pAddr, SECURITY_
IsPeer = false; IsPeer = false;
for(int i = 0; i < m_NumConnectAddrs; i++) for(int i = 0; i < m_NumConnectAddrs; i++)
{ {
IsPeer = IsPeer || m_aConnectAddrs[i] == *pAddr; if(m_aConnectAddrs[i] == *pAddr)
{
IsPeer = true;
break;
}
} }
} }
if(IsPeer) if(IsPeer)