mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-10 02:25:41 +00:00
Use bit check rather than modulo for IsEven
This commit is contained in:
parent
0bafb64ecb
commit
7a0aae3bd5
@ -66,7 +66,7 @@ namespace X10D
|
||||
/// </returns>
|
||||
public static bool IsEven(this short value)
|
||||
{
|
||||
return value % 2 == 0;
|
||||
return (value & 1) == 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -66,7 +66,7 @@ namespace X10D
|
||||
/// </returns>
|
||||
public static bool IsEven(this int value)
|
||||
{
|
||||
return value % 2 == 0;
|
||||
return (value & 1) == 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -66,7 +66,7 @@ namespace X10D
|
||||
/// </returns>
|
||||
public static bool IsEven(this long value)
|
||||
{
|
||||
return value % 2 == 0;
|
||||
return (value & 1) == 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user