MCPcopy Create free account
hub / github.com/defold/defold / HaveSameAddressSet

Function HaveSameAddressSet

engine/dlib/src/dlib/mdns.cpp:442–454  ·  view source on GitHub ↗

Interface enumeration order is not stable across refreshes, so detect topology changes by comparing the address sets rather than array order.

Source from the content-addressed store, hash-verified

440 // Interface enumeration order is not stable across refreshes, so detect
441 // topology changes by comparing the address sets rather than array order.
442 static bool HaveSameAddressSet(const dmArray<dmSocket::Address>& lhs, const dmArray<dmSocket::Address>& rhs)
443 {
444 if (lhs.Size() != rhs.Size())
445 return false;
446
447 for (uint32_t i = 0; i < lhs.Size(); ++i)
448 {
449 if (!ContainsAddress(rhs, lhs[i]))
450 return false;
451 }
452
453 return true;
454 }
455
456 static bool RefreshBrowserInterfaceAddresses(Browser* browser)
457 {

Callers 1

Calls 2

ContainsAddressFunction · 0.85
SizeMethod · 0.45

Tested by

no test coverage detected