1
0
mirror of https://github.com/anope/anope.git synced 2026-06-27 20:26:38 +02:00

Simplify several boolean expressions.

This commit is contained in:
Sadie Powell
2024-02-27 10:16:05 +00:00
parent 9f6d378755
commit 7640fad30c
27 changed files with 40 additions and 50 deletions
+2 -2
View File
@@ -271,10 +271,10 @@ bool IRCDProto::IsNickValid(const Anope::string &nick)
Anope::string special = "[]\\`_^{|}";
for (unsigned i = 0; i < nick.length(); ++i)
if (!(nick[i] >= 'A' && nick[i] <= 'Z') && !(nick[i] >= 'a' && nick[i] <= 'z')
if ((nick[i] < 'A' || nick[i] > 'Z') && (nick[i] < 'a' || nick[i] > 'z')
&& special.find(nick[i]) == Anope::string::npos
&& (Config && Config->NickChars.find(nick[i]) == Anope::string::npos)
&& (!i || (!(nick[i] >= '0' && nick[i] <= '9') && nick[i] != '-')))
&& (!i || ((nick[i] < '0' || nick[i] > '9') && nick[i] != '-')))
return false;
return true;