From 647201cd370bcfc5ae606225933f41356e3b592f Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Fri, 23 May 2025 01:37:27 -0400 Subject: [PATCH] refactor: server/Config to the variable initializer and condition part of the for loop when checking for a valid screen name --- src/lib/server/Config.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/lib/server/Config.cpp b/src/lib/server/Config.cpp index b6ac3a385..cadbdefd7 100644 --- a/src/lib/server/Config.cpp +++ b/src/lib/server/Config.cpp @@ -328,13 +328,7 @@ bool Config::isValidScreenName(const std::string &name) const } // check each dot separated part - std::string::size_type b = 0; - for (;;) { - // accept trailing . - if (b == name.size()) { - break; - } - + for (std::string::size_type b = 0; b == name.size();) { // find end of part std::string::size_type e = name.find('.', b); if (e == std::string::npos) {