MCPcopy Create free account
hub / github.com/N64Recomp/N64Recomp / add_dependencies

Method add_dependencies

include/recompiler/context.h:299–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

297 }
298
299 bool add_dependencies(const std::vector<std::string>& new_dependencies) {
300 dependencies_by_name.reserve(dependencies_by_name.size() + new_dependencies.size());
301
302 // Check if any of the dependencies already exist and fail if so.
303 for (const std::string& dep : new_dependencies) {
304 if (dependencies_by_name.contains(dep)) {
305 return false;
306 }
307 }
308
309 for (const std::string& dep : new_dependencies) {
310 size_t dependency_index = dependencies_by_name.size();
311 dependencies.emplace_back(dep);
312 dependencies_by_name.emplace(dep, dependency_index);
313 }
314
315 dependency_events_by_name.resize(dependencies_by_name.size());
316 dependency_imports_by_name.resize(dependencies_by_name.size());
317 return true;
318 }
319
320 bool find_dependency(const std::string& mod_id, size_t& dependency_index) {
321 auto find_it = dependencies_by_name.find(mod_id);

Callers 1

mainFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected