MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / deepCompare

Function deepCompare

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

396 * This compares all fields of the Require structs in the sets.
397 */
398static bool deepCompare(const std::set<Meta::Require>& a, const std::set<Meta::Require>& b)
399{
400 // NOTE: this needs to be rewritten if the type of Meta::RequireSet changes
401 if (a.size() != b.size()) {
402 return false;
403 }
404 for (const auto& reqA : a) {
405 const auto& iter2 = b.find(reqA);
406 if (iter2 == b.cend()) {
407 return false;
408 }
409 const auto& reqB = *iter2;
410 if (!reqA.deepEquals(reqB)) {
411 return false;
412 }
413 }
414 return true;
415}
416
417void Component::updateCachedData()
418{

Callers 1

updateCachedDataMethod · 0.85

Calls 3

deepEqualsMethod · 0.80
sizeMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected