Add some judge functions. Code cleanup.
This commit is contained in:
@@ -284,21 +284,15 @@ namespace Cryville.Crtr {
|
||||
}
|
||||
|
||||
// Adopted from System.Collections.Generic.ArraySortHelper<T>.InternalBinarySearch(T[] array, int index, int length, T value, IComparer<T> comparer)
|
||||
internal int BinarySearch(float value) {
|
||||
int BinarySearch(float value) {
|
||||
int num = 0;
|
||||
int num2 = RelativeNodes.Count - 1;
|
||||
while (num <= num2) {
|
||||
int num3 = num + (num2 - num >> 1);
|
||||
int num4 = RelativeNodes[num3].Time.Value.CompareTo(value);
|
||||
if (num4 == 0) {
|
||||
return num3;
|
||||
}
|
||||
if (num4 < 0) {
|
||||
num = num3 + 1;
|
||||
}
|
||||
else {
|
||||
num2 = num3 - 1;
|
||||
}
|
||||
if (num4 == 0) return num3;
|
||||
if (num4 < 0) num = num3 + 1;
|
||||
else num2 = num3 - 1;
|
||||
}
|
||||
return ~num;
|
||||
}
|
||||
|
Reference in New Issue
Block a user