Skip to content

Commit 68a353d

Browse files
committed
Handle empty ticks in GetValues method
Added a check in PiecewiseCurve.GetValues to return an empty array when the input ticks list is empty, preventing unnecessary processing and potential errors.
1 parent 589ae76 commit 68a353d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

TuneLab/Data/PiecewiseCurve.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,9 @@ public List<List<Point>> GetInfo()
598598

599599
public double[] GetValues(IReadOnlyList<double> ticks)
600600
{
601+
if (ticks.IsEmpty())
602+
return [];
603+
601604
double[] values = new double[ticks.Count];
602605
values.Fill(double.NaN);
603606
double start = ticks.First();

0 commit comments

Comments
 (0)