Canonifying internal order for plugins and their components to make it

deterministic.
This commit is contained in:
Robin Sommer 2013-07-17 17:31:16 -07:00
parent 57b05a2989
commit d8801bb9c4
8 changed files with 41 additions and 17 deletions

View file

@ -156,9 +156,18 @@ Plugin::component_list Plugin::Components() const
return components;
}
static bool component_cmp(const Component* a, const Component* b)
{
return a->Name() < b->Name();
}
void Plugin::AddComponent(Component* c)
{
components.push_back(c);
// Sort components by name to make sure we have a deterministic
// order.
components.sort(component_cmp);
}
void Plugin::AddBifInitFunction(bif_init_func c)