Adds style cop (#109)

This commit is contained in:
Kamron Batman 2020-04-26 00:16:02 -07:00 committed by GitHub
parent 3e715bcb60
commit 556a17aba8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1725 changed files with 33831 additions and 38046 deletions

View file

@ -7,9 +7,9 @@ namespace Server.Misc
' ', '-', '.', '\''
};
public static readonly char[] Empty = new char[0];
public static readonly char[] Empty = System.Array.Empty<char>();
public static string[] StartDisallowed{ get; } =
public static string[] StartDisallowed { get; } =
{
"seer",
"counselor",
@ -19,7 +19,7 @@ namespace Server.Misc
"lord"
};
public static string[] Disallowed{ get; } =
public static string[] Disallowed { get; } =
{
"jigaboo",
"chigaboo",
@ -129,7 +129,7 @@ namespace Server.Misc
name = name.ToLower();
if (!allowLetters || !allowDigits ||
exceptions.Length > 0 && (noExceptionsAtStart || maxExceptions < int.MaxValue))
(exceptions.Length > 0 && (noExceptionsAtStart || maxExceptions < int.MaxValue)))
for (int i = 0; i < name.Length; ++i)
{
char c = name[i];
@ -156,7 +156,7 @@ namespace Server.Misc
if (c == exceptions[j])
except = true;
if (!except || i == 0 && noExceptionsAtStart)
if (!except || (i == 0 && noExceptionsAtStart))
return false;
if (exceptCount++ == maxExceptions)
@ -195,4 +195,4 @@ namespace Server.Misc
return true;
}
}
}
}