Browse Source

Code Quality: drop redundant if-statement conditions #546

spatial
Christoph Ruegg 9 years ago
parent
commit
b75260ab00
  1. 6
      .paket/Paket.Restore.targets
  2. 4
      src/Numerics/SpecialFunctions/Erf.cs
  3. 8
      src/Numerics/Statistics/MovingStatistics.cs

6
.paket/Paket.Restore.targets

@ -23,6 +23,9 @@
<_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)"))</_PaketExeExtension>
<PaketCommand Condition=" '$(_PaketExeExtension)' == '.dll' ">dotnet "$(PaketExePath)"</PaketCommand>
<!-- no extension is a shell script -->
<PaketCommand Condition=" '$(_PaketExeExtension)' == '' ">"$(PaketExePath)"</PaketCommand>
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' AND Exists('$(PaketRootPath)paket.bootstrapper.exe')">$(PaketRootPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
<PaketBootStrapperCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>
@ -145,9 +148,10 @@
</DotNetCliToolReference>
</ItemGroup>
<!-- Disabled for now until we know what to do with runtime deps - https://github.com/fsprojects/Paket/issues/2964
<PropertyGroup>
<RestoreConfigFile>$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).NuGet.Config</RestoreConfigFile>
</PropertyGroup>
</PropertyGroup> -->
</Target>

4
src/Numerics/SpecialFunctions/Erf.cs

@ -421,7 +421,7 @@ namespace MathNet.Numerics
result = (z*1.125) + (z*Evaluate.Polynomial(z, ErfImpAn)/Evaluate.Polynomial(z, ErfImpAd));
}
}
else if ((z < 110) || ((z < 110) && invert))
else if (z < 110)
{
// We'll be calculating erfc:
invert = !invert;
@ -488,7 +488,7 @@ namespace MathNet.Numerics
}
else if (z < 60)
{
// Worst case absolute error found: 5.896543869e-24
// Worst case absolute error found: 5.896543869e-24
r = Evaluate.Polynomial(z - 38, ErfImpLn) /Evaluate.Polynomial(z - 38, ErfImpLd);
b = 0.5640528202F;
}

8
src/Numerics/Statistics/MovingStatistics.cs

@ -162,7 +162,7 @@ namespace MathNet.Numerics.Statistics
{
get
{
if (_lastNaNTimeToLive > 0 || _lastNegInfTimeToLive > 0 || (_lastPosInfTimeToLive > 0 && _lastNegInfTimeToLive > 0))
if (_lastNaNTimeToLive > 0 || _lastNegInfTimeToLive > 0)
{
return double.NaN;
}
@ -185,7 +185,7 @@ namespace MathNet.Numerics.Statistics
{
get
{
if (_lastNaNTimeToLive > 0 || _lastNegInfTimeToLive > 0 || (_lastPosInfTimeToLive > 0 && _lastNegInfTimeToLive > 0))
if (_lastNaNTimeToLive > 0 || _lastNegInfTimeToLive > 0)
{
return double.NaN;
}
@ -208,7 +208,7 @@ namespace MathNet.Numerics.Statistics
{
get
{
if (_lastNaNTimeToLive > 0 || _lastNegInfTimeToLive > 0 || (_lastPosInfTimeToLive > 0 && _lastNegInfTimeToLive > 0))
if (_lastNaNTimeToLive > 0 || _lastNegInfTimeToLive > 0)
{
return double.NaN;
}
@ -231,7 +231,7 @@ namespace MathNet.Numerics.Statistics
{
get
{
if (_lastNaNTimeToLive > 0 || _lastNegInfTimeToLive > 0 || (_lastPosInfTimeToLive > 0 && _lastNegInfTimeToLive > 0))
if (_lastNaNTimeToLive > 0 || _lastNegInfTimeToLive > 0)
{
return double.NaN;
}

Loading…
Cancel
Save