From f55c750ec6640855930f76a3fb46d9b404ddf512 Mon Sep 17 00:00:00 2001 From: Sergii Kryvonos Date: Sun, 29 Sep 2024 10:40:46 +0200 Subject: [PATCH] De-bug common Valuable::reciprocal --- omnn/math/Product.cpp | 6 +++--- omnn/math/Valuable.cpp | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/omnn/math/Product.cpp b/omnn/math/Product.cpp index 6e5536712..8c6843ebb 100644 --- a/omnn/math/Product.cpp +++ b/omnn/math/Product.cpp @@ -895,8 +895,8 @@ namespace math { } else if (v.IsExponentiation()) { - auto& e = v.as(); - auto& vExpBase = e.getBase(); + auto& exponentiation = v.as(); + auto& vExpBase = exponentiation.getBase(); for (auto it = members.begin(); it != members.end();) { if (it->IsExponentiation() && @@ -907,7 +907,7 @@ namespace math { } else if (vExpBase == *it) { - Update(it, vExpBase ^ (e.getExponentiation() + 1)); + Update(it, vExpBase ^ (exponentiation.getExponentiation() + 1)); goto yes; } else diff --git a/omnn/math/Valuable.cpp b/omnn/math/Valuable.cpp index fb4fc799c..e25828251 100644 --- a/omnn/math/Valuable.cpp +++ b/omnn/math/Valuable.cpp @@ -453,6 +453,7 @@ namespace math { #if !defined(NDEBUG) && !defined(NOOMDEBUG) if(s.size() > 1){ + OptimizeOn oo; auto distinct = Distinct(); if (distinct != s) { std::stringstream ss; @@ -2103,7 +2104,7 @@ bool Valuable::SerializedStrEqual(const std::string_view& s) const { if (exp) return exp->reciprocal(); else { - return Become(Exponentiation{std::move(*this), constants::minus_1}); + return Become(Exponentiation{Move(), constants::minus_1}); } }