Use single sort predicate
git-svn-id: file:///home/vcs/svn/jsweeper/trunk@32 6611ac79-6612-48ef-a1e9-b906f853523emaster
parent
5534732bf3
commit
1baa932fc3
|
@ -272,36 +272,26 @@ Port *PortManager::FindPort(jack_port_t *port)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static bool ClientSortPredicate(const Client *lhs, const Client *rhs)
|
||||
{
|
||||
return lhs->m_name < rhs->m_name;
|
||||
}
|
||||
|
||||
static bool PortGroupSortPredicate(const PortGroup *lhs, const PortGroup *rhs)
|
||||
{
|
||||
return lhs->m_name < rhs->m_name;
|
||||
}
|
||||
|
||||
static bool PortSortPredicate(const Port *lhs, const Port *rhs)
|
||||
static bool BaseSortPredicate(const Base *lhs, const Base *rhs)
|
||||
{
|
||||
return lhs->m_name < rhs->m_name;
|
||||
}
|
||||
|
||||
void PortManager::Sort()
|
||||
{
|
||||
m_clients.sort(&ClientSortPredicate);
|
||||
m_clients.sort(&BaseSortPredicate);
|
||||
|
||||
ClientList::iterator clit;
|
||||
for (clit = m_clients.begin(); clit != m_clients.end(); ++clit) {
|
||||
Client *c = *clit;
|
||||
|
||||
c->m_groups.sort(&PortGroupSortPredicate);
|
||||
c->m_groups.sort(&BaseSortPredicate);
|
||||
|
||||
PortGroupList::iterator pglit;
|
||||
for (pglit = c->m_groups.begin(); pglit != c->m_groups.end(); ++pglit) {
|
||||
PortGroup *pg = *pglit;
|
||||
|
||||
pg->m_ports.sort(&PortSortPredicate);
|
||||
pg->m_ports.sort(&BaseSortPredicate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue