From b8e393bf3650b192fa95d59fa240557f00d37d4b Mon Sep 17 00:00:00 2001 From: Alessandro Sidero <75628365+Alessandro624@users.noreply.github.com> Date: Tue, 15 Apr 2025 16:24:20 +0200 Subject: [PATCH] reset: using assert for validation --- eo/src/eoRanking.h | 14 +------------- eo/src/eoRankingCached.h | 14 +------------- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/eo/src/eoRanking.h b/eo/src/eoRanking.h index ea82ed5f0..a8e6b69d1 100644 --- a/eo/src/eoRanking.h +++ b/eo/src/eoRanking.h @@ -48,19 +48,7 @@ public: */ eoRanking(double _p = 2.0, double _e = 1.0) : pressure(_p), exponent(_e) { - if (pressure <= 1.0) - { - std::string msg = "eoRanking: pressure must be > 1.0"; - eo::log << eo::errors << "ERROR: " << msg << std::endl; - throw eoException(msg); - } - - if (exponent > 2.0) - { - std::string msg = "eoRanking: exponent must be <= 2.0"; - eo::log << eo::errors << "ERROR: " << msg << std::endl; - throw eoException(msg); - } + assert(1 < pressure and exponent <= 2); } /* helper function: finds index in _pop of _eo, an EOT * */ diff --git a/eo/src/eoRankingCached.h b/eo/src/eoRankingCached.h index 81cfa60d4..65b8c5fce 100644 --- a/eo/src/eoRankingCached.h +++ b/eo/src/eoRankingCached.h @@ -59,19 +59,7 @@ public: */ eoRankingCached(double _p = 2.0, double _e = 1.0) : pressure(_p), exponent(_e), cached_pSize(0) { - if (pressure <= 1.0) - { - std::string msg = "eoRankingCached: pressure must be > 1.0"; - eo::log << eo::errors << "ERROR: " << msg << std::endl; - throw eoException(msg); - } - - if (exponent > 2.0) - { - std::string msg = "eoRankingCached: exponent must be <= 2.0"; - eo::log << eo::errors << "ERROR: " << msg << std::endl; - throw eoException(msg); - } + assert(1 < pressure and exponent <= 2); } /*