[poincare] Change comparesTo + virtual nodeCompareTo -> virtual compareTo

Change-Id: Ie54b3652ad1d5845f084b4b49ca0eb96198b853a
This commit is contained in:
Émilie Feral
2017-09-25 14:36:41 +02:00
parent 19b606c825
commit ceeb43cd5f
6 changed files with 31 additions and 39 deletions

View File

@@ -142,8 +142,8 @@ Expression * Integer::clone() const {
// Comparison
int Integer::nodeComparesTo(const Expression * e) const {
int typeComparison = Expression::nodeComparesTo(e);
int Integer::compareTo(const Expression * e) const {
int typeComparison = Expression::compareTo(e);
if (typeComparison != 0) {
return typeComparison;
}
@@ -160,11 +160,11 @@ int Integer::nodeComparesTo(const Expression * e) const {
}
bool Integer::isEqualTo(const Integer & other) const {
return (nodeComparesTo(&other) == 0);
return (compareTo(&other) == 0);
}
bool Integer::isLowerThan(const Integer & other) const {
return (nodeComparesTo(&other) < 0);
return (compareTo(&other) < 0);
}
// Arithmetic