mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-14 00:14:18 +00:00
Replaced some old juce-style sort operations with std::sort and lambdas
This commit is contained in:
parent
3659742a3a
commit
d4a7afa73f
17 changed files with 132 additions and 269 deletions
|
|
@ -142,18 +142,12 @@ const ModuleDescription* ModuleList::getModuleWithID (const String& moduleID) co
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
struct ModuleSorter
|
||||
{
|
||||
static int compareElements (const ModuleDescription* m1, const ModuleDescription* m2)
|
||||
{
|
||||
return m1->getID().compareIgnoreCase (m2->getID());
|
||||
}
|
||||
};
|
||||
|
||||
void ModuleList::sort()
|
||||
{
|
||||
ModuleSorter sorter;
|
||||
modules.sort (sorter);
|
||||
std::sort (modules.begin(), modules.end(), [] (const ModuleDescription* m1, const ModuleDescription* m2)
|
||||
{
|
||||
return m1->getID().compareIgnoreCase (m2->getID()) < 0;
|
||||
});
|
||||
}
|
||||
|
||||
StringArray ModuleList::getIDs() const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue