Inline and simplify all `Range<float>` usage
This commit is contained in:
parent
e44810a725
commit
ccfd702484
|
@ -230,8 +230,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
// reset way-out-of-range values
|
||||
if (diff > 1.0f)
|
||||
diff = 1.0f;
|
||||
if (!(-1.0f).RangeTo(1.0f).Contains(error))
|
||||
error = 0.0f;
|
||||
if (Math.Abs(error) > 1.0f) error = 0.0f;
|
||||
if (diffUnthrottled > 1.0f)
|
||||
diffUnthrottled = desiredspf;
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ using System.Xml.XPath;
|
|||
using System.Xml.Linq;
|
||||
|
||||
using BizHawk.Client.Common;
|
||||
using BizHawk.Common;
|
||||
using BizHawk.Emulation.Cores.Nintendo.NES;
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
|
@ -63,11 +62,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
float a = FreqTable[i - 1];
|
||||
float b = FreqTable[i];
|
||||
float c = FreqTable[i + 1];
|
||||
var range = ((a + b) / 2).RangeTo((b + c) / 2);
|
||||
if (range.Contains(freq))
|
||||
{
|
||||
return i - 1;
|
||||
}
|
||||
if ((a + b) / 2 <= freq && freq <= (b + c) / 2) return i - 1;
|
||||
}
|
||||
|
||||
return 95; // I guess?
|
||||
|
|
Loading…
Reference in New Issue