fix sloppy definition of less-than comparison, which caused malfunction of registry

This commit is contained in:
Fischlurch 2009-10-09 01:29:24 +02:00
parent 2ad896027b
commit 37cd451367
3 changed files with 6 additions and 3 deletions

View file

@ -103,7 +103,8 @@ namespace control {
bool
operator() (const Command *pC1, const Command *pC2) const
{
return ( pC1 && pC2 && (*pC1 < *pC2));
return (!pC1 && pC2)
|| ( pC1 && pC2 && (*pC1 < *pC2));
}
};

View file

@ -90,7 +90,8 @@ namespace control {
static format fmt("Command \"%s\" not found");
if (!cmd)
throw error::Invalid(str(fmt % cmdID), LUMIERA_ERROR_INVALID_COMMAND);
ENSURE (cmdID == CommandRegistry::instance().findDefinition(cmd));
return cmd;
}

View file

@ -264,7 +264,8 @@ namespace control {
inline bool
operator< (Command const& c1, Command const& c2)
{
return ( c1 && c2 && (&c1.impl() < &c2.impl()));
return (!c1 && c2)
|| ( c1 && c2 && (&c1.impl() < &c2.impl()));
}