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

Function getTrivialRemovals

launcher/minecraft/ComponentUpdateTask.cpp:384–400  ·  view source on GitHub ↗

Get list of uids that can be trivially removed because nothing is depending on them anymore (and they are installed as deps)

Source from the content-addressed store, hash-verified

382
383/// Get list of uids that can be trivially removed because nothing is depending on them anymore (and they are installed as deps)
384static void getTrivialRemovals(const ComponentContainer & components, const RequireExSet & reqs, QStringList &toRemove)
385{
386 for(const auto & component: components)
387 {
388 if(!component->m_dependencyOnly)
389 continue;
390 if(!component->m_cachedVolatile)
391 continue;
392 RequireEx reqNeedle;
393 reqNeedle.uid = component->m_uid;
394 const auto iter = reqs.find(reqNeedle);
395 if(iter == reqs.cend())
396 {
397 toRemove.append(component->m_uid);
398 }
399 }
400}
401
402/**
403 * handles:

Callers 1

resolveDependenciesMethod · 0.85

Calls 2

appendMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected