From 00b474eee5dcba64075898987ff684f71ca3607d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 22 Nov 2022 05:46:53 -0500 Subject: [PATCH] simplify --- src/error.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/error.cpp b/src/error.cpp index b351c64ad1..c49bc6ce58 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -122,8 +122,7 @@ void Error::universe_one(const std::string &file, int line, const std::string &s void Error::universe_warn(const std::string &file, int line, const std::string &str) { ++numwarn; - if (maxwarn < 0) return; - if (maxwarn != 0 && ((numwarn > maxwarn) || (allwarn > maxwarn))) return; + if ((maxwarn != 0) && ((numwarn > maxwarn) || (allwarn > maxwarn) || (maxwarn < 0))) return; if (universe->uscreen) fmt::print(universe->uscreen,"WARNING on proc {}: {} ({}:{})\n", universe->me,str,truncpath(file),line); @@ -255,8 +254,7 @@ void Error::_one(const std::string &file, int line, fmt::string_view format, void Error::warning(const std::string &file, int line, const std::string &str) { ++numwarn; - if (maxwarn < 0) return; - if (maxwarn != 0 && ((numwarn > maxwarn) || (allwarn > maxwarn))) return; + if ((maxwarn != 0) && ((numwarn > maxwarn) || (allwarn > maxwarn) || (maxwarn < 0))) return; std::string mesg = fmt::format("WARNING: {} ({}:{})\n", str,truncpath(file),line); if (screen) fputs(mesg.c_str(),screen);