refactor: server/Config to the variable initializer and condition part of the for loop when checking for a valid screen name

This commit is contained in:
sithlord48
2025-05-23 01:37:27 -04:00
committed by Chris Rizzitello
parent e24b1c4b68
commit 647201cd37

View File

@ -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) {