diff --git a/src/addoncreator/AddonWhitelist.cs b/src/addoncreator/AddonWhitelist.cs index 1e96833..e332e3e 100644 --- a/src/addoncreator/AddonWhitelist.cs +++ b/src/addoncreator/AddonWhitelist.cs @@ -1,12 +1,13 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Text; using System.Text.RegularExpressions; namespace GarrysMod.AddonCreator { - public class AddonWhitelist + public static class AddonWhitelist { private static readonly string[] Whitelist = { @@ -69,20 +70,20 @@ namespace GarrysMod.AddonCreator "gamemodes/*/content/sound/*.ogg" }; - private static Regex[] RegularExpressions; + private static Regex[] _regularExpressions; static void ConvertWhitelist() { - if (RegularExpressions != null) + if (_regularExpressions != null) return; - RegularExpressions = Whitelist.Select(w => w.WildcardRegex()).ToArray(); + _regularExpressions = Whitelist.Select(w => w.WildcardRegex()).ToArray(); } public static IEnumerable FindBlacklistedFiles(IEnumerable files) { ConvertWhitelist(); - return files.Where(f => RegularExpressions.Any(rx => !rx.IsMatch(f))); + return files.Where(f => !_regularExpressions.Any(rx => rx.IsMatch(f))); } } }