MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / deepCompare

Function deepCompare

launcher/minecraft/Component.cpp:410–431  ·  view source on GitHub ↗

* deep inspecting compare for requirement sets * By default, only uids are compared for set operations. * This compares all fields of the Require structs in the sets. */

Source from the content-addressed store, hash-verified

408 * This compares all fields of the Require structs in the sets.
409 */
410static bool deepCompare(const std::set<Meta::Require> & a, const std::set<Meta::Require> & b)
411{
412 // NOTE: this needs to be rewritten if the type of Meta::RequireSet changes
413 if(a.size() != b.size())
414 {
415 return false;
416 }
417 for(const auto & reqA :a)
418 {
419 const auto &iter2 = b.find(reqA);
420 if(iter2 == b.cend())
421 {
422 return false;
423 }
424 const auto & reqB = *iter2;
425 if(!reqA.deepEquals(reqB))
426 {
427 return false;
428 }
429 }
430 return true;
431}
432
433void Component::updateCachedData()
434{

Callers 1

updateCachedDataMethod · 0.85

Calls 3

deepEqualsMethod · 0.80
sizeMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected