diff --git a/X10D/src/ByteExtensions/ByteExtensions.cs b/X10D/src/ByteExtensions/ByteExtensions.cs index 13a5468..c078fa8 100644 --- a/X10D/src/ByteExtensions/ByteExtensions.cs +++ b/X10D/src/ByteExtensions/ByteExtensions.cs @@ -1,4 +1,4 @@ -namespace X10D +namespace X10D { /// /// Extension methods for . @@ -50,64 +50,7 @@ /// public static bool IsPrime(this byte value) { - return value switch - { - 2 => true, - 3 => true, - 5 => true, - 7 => true, - 11 => true, - 13 => true, - 17 => true, - 19 => true, - 23 => true, - 29 => true, - 31 => true, - 37 => true, - 41 => true, - 43 => true, - 47 => true, - 53 => true, - 59 => true, - 61 => true, - 67 => true, - 71 => true, - 73 => true, - 79 => true, - 83 => true, - 89 => true, - 97 => true, - 101 => true, - 103 => true, - 107 => true, - 109 => true, - 113 => true, - 127 => true, - 131 => true, - 137 => true, - 139 => true, - 149 => true, - 151 => true, - 157 => true, - 163 => true, - 167 => true, - 173 => true, - 179 => true, - 181 => true, - 191 => true, - 193 => true, - 197 => true, - 199 => true, - 211 => true, - 223 => true, - 227 => true, - 229 => true, - 233 => true, - 239 => true, - 241 => true, - 251 => true, - _ => false - }; + return ((int)value).IsPrime(); } ///