MCPcopy Create free account
hub / github.com/MultiMC/Launcher / deepCompare

Function deepCompare

launcher/minecraft/Component.cpp:375–396  ·  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

373 * This compares all fields of the Require structs in the sets.
374 */
375static bool deepCompare(const std::set<Meta::Require> & a, const std::set<Meta::Require> & b)
376{
377 // NOTE: this needs to be rewritten if the type of Meta::RequireSet changes
378 if(a.size() != b.size())
379 {
380 return false;
381 }
382 for(const auto & reqA :a)
383 {
384 const auto &iter2 = b.find(reqA);
385 if(iter2 == b.cend())
386 {
387 return false;
388 }
389 const auto & reqB = *iter2;
390 if(!reqA.deepEquals(reqB))
391 {
392 return false;
393 }
394 }
395 return true;
396}
397
398void Component::updateCachedData()
399{

Callers 1

updateCachedDataMethod · 0.85

Calls 3

deepEqualsMethod · 0.80
sizeMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected