Unroll loop for the last control point

This commit is contained in:
smoogipoo 2018-10-17 11:39:29 +09:00
parent 336b6fa38e
commit 1bebceada7
1 changed files with 4 additions and 1 deletions

View File

@ -104,8 +104,11 @@ private T binarySearch<T>(SortedList<T> list, double time, T prePoint = null)
if (time < list[0].Time)
return prePoint ?? new T();
if (time >= list[list.Count - 1].Time)
return list[list.Count - 1];
int l = 0;
int r = list.Count - 1;
int r = list.Count - 2;
while (l <= r)
{