COMMON: Use appropriate equals() in BaseString

Remove a useless creation of a BaseString object with a C string in
comparison operators of this class, because there is a function
equals() that accepts a C string in parameter.
This commit is contained in:
Mathias Parnaudeau 2020-11-06 10:44:25 +01:00 committed by Thierry Crozat
parent f969365688
commit 4880fab063

View File

@ -316,7 +316,7 @@ TEMPLATE bool BASESTRING::operator==(const BaseString &x) const {
}
TEMPLATE bool BASESTRING::operator==(const value_type *x) const {
return equals(BaseString(x));
return equals(x);
}
TEMPLATE bool BASESTRING::operator!=(const BaseString &x) const {
@ -324,7 +324,7 @@ TEMPLATE bool BASESTRING::operator!=(const BaseString &x) const {
}
TEMPLATE bool BASESTRING::operator!=(const value_type *x) const {
return !equals(BaseString(x));
return !equals(x);
}
TEMPLATE int BASESTRING::compareTo(const BaseString &x) const {