fix StepsID::operator<

beware: invalid < operations (where a<b and b<a can both be true)
lead to crashes with std::map on glibc
This commit is contained in:
Glenn Maynard
2004-04-26 00:08:51 +00:00
parent 9707e6bb0c
commit 8f7e6894dc
2 changed files with 11 additions and 4 deletions
+10
View File
@@ -205,3 +205,13 @@ bool StepsID::IsValid() const
return st != STEPS_TYPE_INVALID && dc != DIFFICULTY_INVALID;
}
bool StepsID::operator<( const StepsID &rhs ) const
{
#define COMP(a) if(a<rhs.a) return true; if(a>rhs.a) return false;
COMP(st);
COMP(dc);
COMP(sDescription);
COMP(uHash);
#undef COMP
return false;
}