From f82f4d2c6541754e2ac5e600ebd0c7b795bb3f79 Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 15 Dec 2025 14:35:26 +0100 Subject: [PATCH] Refactor RestType enum: remove Invalid, use byte RestType now inherits from byte for efficiency. The Invalid value has been removed from the enum, and the IsValid extension method was updated to reflect this change by only checking for None. --- src/ReC.Domain/Constants/RestType.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ReC.Domain/Constants/RestType.cs b/src/ReC.Domain/Constants/RestType.cs index 0cea436..da43057 100644 --- a/src/ReC.Domain/Constants/RestType.cs +++ b/src/ReC.Domain/Constants/RestType.cs @@ -1,6 +1,6 @@ namespace ReC.Domain.Constants; -public enum RestType +public enum RestType : byte { None = 0, Get = 1, @@ -12,7 +12,6 @@ public enum RestType Options = 7, Connect = 8, Trace = 9, - Invalid = -1, } public static class RestTypeExtensions @@ -24,6 +23,6 @@ public static class RestTypeExtensions public static bool IsValid(this RestType restType) { - return restType != RestType.Invalid && restType != RestType.None; + return restType != RestType.None; } } \ No newline at end of file