mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-10 15:57:53 +00:00
chore: code cleanup (mostly whitespace / remove unused imports)
This commit is contained in:
parent
56155782c3
commit
7afba4ea95
29 changed files with 84 additions and 105 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue