Match the value of the literals.

This commit is contained in:
Roberto Raggi
2009-11-13 15:17:27 +01:00
parent baffd97efb
commit 1a7855af22
3 changed files with 18 additions and 16 deletions

View File

@@ -72,6 +72,19 @@ Literal::Literal(const char *chars, unsigned size)
Literal::~Literal()
{ delete[] _chars; }
bool Literal::isEqualTo(const Literal *other) const
{
if (! other)
return false;
else if (this == other)
return true;
else if (hashCode() != other->hashCode())
return false;
else if (size() != other->size())
return false;
return ! strcmp(chars(), other->chars());
}
Literal::iterator Literal::begin() const
{ return _chars; }
@@ -214,17 +227,3 @@ Identifier::Identifier(const char *chars, unsigned size)
Identifier::~Identifier()
{ }
bool Identifier::isEqualTo(const Identifier *other) const
{
if (! other)
return false;
else if (this == other)
return true;
else if (hashCode() != other->hashCode())
return false;
else if (size() != other->size())
return false;
return ! strcmp(chars(), other->chars());
}