mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-22 19:58:49 +00:00
perf: remove redundant 0 check in Sqrt
This check was a defensive manoeuvrer in the event that the input is 0, but this condition has already been verified to be false with the switch guard clause. This changes bumps coverage to 100% for Sqrt.
This commit is contained in:
parent
3d2baf595b
commit
c8ccb1deb8
@ -198,11 +198,6 @@ public static class DecimalExtensions
|
||||
do
|
||||
{
|
||||
previous = current;
|
||||
if (previous == 0.0m)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
current = (previous + value / previous) / 2;
|
||||
} while (System.Math.Abs(previous - current) > 0.0m);
|
||||
|
||||
|
@ -460,11 +460,6 @@ public static class DoubleExtensions
|
||||
do
|
||||
{
|
||||
previous = current;
|
||||
if (previous == 0.0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
current = (previous + value / previous) / 2;
|
||||
} while (System.Math.Abs(previous - current) > double.Epsilon);
|
||||
|
||||
|
@ -419,11 +419,6 @@ public static class SingleExtensions
|
||||
do
|
||||
{
|
||||
previous = current;
|
||||
if (previous == 0.0f)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
current = (previous + value / previous) / 2;
|
||||
} while (MathF.Abs(previous - current) > float.Epsilon);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user