diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2009-11-13 15:17:27 +0100 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2009-11-13 15:17:27 +0100 |
commit | 1a7855af220156f00bdbb38a5cd53f11c6f9a0fb (patch) | |
tree | f9e3ccdadc23a8a7d76581a1ce99f52a122f4af1 /src/shared/cplusplus/Literals.cpp | |
parent | baffd97efb1fd6da004fedf620577f8a97445793 (diff) | |
download | qt-creator-1a7855af220156f00bdbb38a5cd53f11c6f9a0fb.tar.gz |
Match the value of the literals.
Diffstat (limited to 'src/shared/cplusplus/Literals.cpp')
-rw-r--r-- | src/shared/cplusplus/Literals.cpp | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/shared/cplusplus/Literals.cpp b/src/shared/cplusplus/Literals.cpp index 40042eb66e..078c070270 100644 --- a/src/shared/cplusplus/Literals.cpp +++ b/src/shared/cplusplus/Literals.cpp @@ -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()); -} - - |