leverage the pre-existing vector<foo>.sort(&method) hooks for better self containment. also sort by dependency count, and above all else, skip sorting entirely if we've already populated mModulesLoaded since that already takes dependencies into account when generating the vector

also defualt to using that one for the general findmodules case
This commit is contained in:
AzaezelX 2022-10-30 14:02:30 -05:00
parent b48d462fbe
commit ebcee97d5c
3 changed files with 51 additions and 42 deletions

View file

@ -157,7 +157,7 @@ DefineEngineMethod(ModuleManager, findModules, String, (bool loadedOnly), (false
"@return A list of space - separated module definition object Ids.\n")
{
// Find module type definitions.
Vector<const ModuleDefinition*> moduleDefinitions;
Vector<ModuleDefinition*> moduleDefinitions;
// Find modules.
object->findModules( loadedOnly, moduleDefinitions );