| 456 | for (const auto& moduleName : strategy->valdiModules) { |
| 457 | self->getBundle(moduleName); |
| 458 | } |
| 459 | }); |
| 460 | } |
| 461 | |
| 462 | void ResourceManager::warmUpBundles(const std::vector<StringBox>& modulePaths) { |
| 463 | FlatSet<StringBox> seen; |
| 464 | std::vector<StringBox> bundles; |
| 465 | for (const auto& path : modulePaths) { |
| 466 | auto sv = path.toStringView(); |
| 467 | auto slash = sv.find('/'); |
| 468 | if (slash != std::string_view::npos) { |
| 469 | auto bundleName = StringCache::getGlobal().makeString(sv.substr(0, slash)); |
| 470 | if (seen.insert(bundleName).second) { |
| 471 | bundles.push_back(bundleName); |
| 472 | } |
| 473 | } |
| 474 | } |
| 475 | |
| 476 | _workerQueue->async([self = strongSmallRef(this), bundles = std::move(bundles)]() { |
| 477 | VALDI_TRACE("Valdi.warmUpBundles"); |
| 478 | for (const auto& bundleName : bundles) { |
| 479 | self->getBundle(bundleName); |
| 480 | } |
| 481 | }); |
no test coverage detected