fix sloppy definition of less-than comparison, which caused malfunction of registry
This commit is contained in:
parent
2ad896027b
commit
37cd451367
3 changed files with 6 additions and 3 deletions
|
|
@ -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));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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()));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue