chore: code cleanup (mostly whitespace / remove unused imports)

This commit is contained in:
spiral
2022-03-30 04:36:22 -04:00
parent 56155782c3
commit 7afba4ea95
29 changed files with 84 additions and 105 deletions

View File

@@ -9,6 +9,7 @@ public static class Limits
public static readonly int MaxMemberCount = 1000;
public static readonly int MaxGroupCount = 250;
public static int WarnThreshold(int limit) => limit - 50;
public static readonly int MaxDescriptionLength = 1000;
public static readonly int MaxProxyTagLength = 100;
public static readonly int MaxSwitchMemberCount = 150;

View File

@@ -4,7 +4,7 @@ namespace PluralKit.Core;
public static class Proto
{
private static Dictionary<string, MessageParser> _parser = new();
private static readonly Dictionary<string, MessageParser> _parser = new();
public static byte[] Marshal(this IMessage message) => message.ToByteArray();
@@ -12,11 +12,11 @@ public static class Proto
{
var type = typeof(T).ToString();
if (_parser.ContainsKey(type))
return (T)_parser[type].ParseFrom(message);
else
{
_parser.Add(type, new MessageParser<T>(() => new T()));
return Unmarshal<T>(message);
return (T)_parser[type].ParseFrom(message);
}
_parser.Add(type, new MessageParser<T>(() => new T()));
return Unmarshal<T>(message);
}
}