Exemplo n.º 1
0
        private static int?BinarySearchLess(List <OrderDelayWrap> list, OrderDelayWrap item,
                                            Comparer <OrderDelayWrap> comparer)
        {
            var resIndex = list.BinarySearch(
                item, comparer);

            if (resIndex > 0)
            {
                return(resIndex);
            }

            resIndex = ~resIndex;

            for (int i = resIndex - 1; i >= 0; i--)
            {
                if (comparer.Compare(list[i], item) == -1)
                {
                    return(i);
                }
            }

            return(null);
        }
Exemplo n.º 2
0
 public BigDelay(int delay, OrderDelayWrap previousOrder, OrderDelayWrap order)
 {
     Delay         = delay;
     PreviousOrder = previousOrder;
     Order         = order;
 }