]> www.ginac.de Git - ginac.git/blobdiff - ginac/power.cpp
removed a lot of superfluous const_cast<>()s
[ginac.git] / ginac / power.cpp
index 47efc2fd3806583b0e61197354111f090b11755e..76c72acc58160379f1a17b015f04e282a85deedd 100644 (file)
@@ -544,14 +544,13 @@ ex power::derivative(const symbol & s) const
 int power::compare_same_type(const basic & other) const
 {
        GINAC_ASSERT(is_exactly_of_type(other, power));
-       const power & o=static_cast<const power &>(const_cast<basic &>(other));
+       const power &o = static_cast<const power &>(other);
 
-       int cmpval;
-       cmpval=basis.compare(o.basis);
-       if (cmpval==0) {
+       int cmpval = basis.compare(o.basis);
+       if (cmpval)
+               return cmpval;
+       else
                return exponent.compare(o.exponent);
-       }
-       return cmpval;
 }
 
 unsigned power::return_type(void) const