MCPcopy Create free account
hub / github.com/ElyPrismLauncher/Launcher / getIdMapping

Function getIdMapping

launcher/InstanceList.cpp:455–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

453}
454
455static QMap<InstanceId, InstanceLocator> getIdMapping(const std::vector<std::unique_ptr<BaseInstance>>& list)
456{
457 QMap<InstanceId, InstanceLocator> out;
458 int i = 0;
459 for (auto& item : list) {
460 auto id = item->id();
461 if (out.contains(id)) {
462 qWarning() << "Duplicate ID" << id << "in instance list";
463 }
464 out[id] = std::make_pair(item.get(), i);
465 i++;
466 }
467 return out;
468}
469
470QList<InstanceId> InstanceList::discoverInstances()
471{

Callers 1

loadListMethod · 0.85

Calls 3

idMethod · 0.45
containsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected