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

Function getTrivialRemovals

launcher/minecraft/ComponentUpdateTask.cpp:392–408  ·  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

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

Callers 1

resolveDependenciesMethod · 0.85

Calls 2

appendMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected