mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-21 12:08:05 +00:00
style patterns
This commit is contained in:
@@ -347,8 +347,15 @@ public class MeTests
|
||||
var actual = new TSeries();
|
||||
var predicted = new TSeries();
|
||||
|
||||
for (int i = 0; i < 10; i++) actual.Add(DateTime.UtcNow, i);
|
||||
for (int i = 0; i < 5; i++) predicted.Add(DateTime.UtcNow, i);
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
actual.Add(DateTime.UtcNow, i);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
predicted.Add(DateTime.UtcNow, i);
|
||||
}
|
||||
|
||||
Assert.Throws<ArgumentException>(() => Me.Calculate(actual, predicted, 3));
|
||||
}
|
||||
@@ -382,4 +389,4 @@ public class MeTests
|
||||
// After resync, result should still be correct
|
||||
Assert.Equal(10.0, me.Last.Value, 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+5
-2
@@ -51,7 +51,10 @@ public sealed class Me : BiInputIndicatorBase
|
||||
ValidateBatchInputs(actual, predicted, output, period);
|
||||
|
||||
int len = actual.Length;
|
||||
if (len == 0) return;
|
||||
if (len == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const int StackAllocThreshold = 256;
|
||||
if (len <= StackAllocThreshold)
|
||||
@@ -75,4 +78,4 @@ public sealed class Me : BiInputIndicatorBase
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user