From 95e5e35b6acffee01cc7d2b2b0cb505dbb23aef1 Mon Sep 17 00:00:00 2001 From: Timothy Schenk Date: Thu, 29 Dec 2022 13:54:17 +0100 Subject: [PATCH] Refactor where clause --- Server.Packets/PacketForwardingService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Server.Packets/PacketForwardingService.cs b/Server.Packets/PacketForwardingService.cs index 8f08b79..ba4833c 100644 --- a/Server.Packets/PacketForwardingService.cs +++ b/Server.Packets/PacketForwardingService.cs @@ -17,8 +17,8 @@ public class PacketForwardingService // Get all types that implement IPacket and have a PacketIdAttribute _packets = assembly.GetTypes() .Select(x => (attr: x.GetCustomAttribute(), ctor: x.GetConstructor(Type.EmptyTypes))) - .Where(x => x.attr != null && x.ctor != null && x.GetType().IsAssignableTo(typeof(IPacket)) && - x.GetType().IsClass) + .Where(x => x.GetType().IsAssignableTo(typeof(IPacket)) && x.GetType().IsClass) + .Where(x => x.attr != null && x.ctor != null) .ToImmutableDictionary(x => x.attr!.PacketId, x => x.ctor)!; }