0x7CFE / llst

LLVM powered Little Smalltalk.
Other
93 stars 10 forks source link

Compare operator for char* and TSymbol* misses the case of equality #1

Closed kpp closed 11 years ago

kpp commented 11 years ago

Function to fix:

bool TDictionary::compareSymbols::operator() (const char* left, const TSymbol* right) const
{
    return !operator()(right, left);
}

The code uses operator() (const TSymbol* left, const char* right) to implement the compare function in a wrong way. It misses the case when 'left' is equal to 'right'.

Possible solution:

return !operator()(right, left) && left != right;