Пример #1
0
 private static IExchangeChain KeepFasterChain(IExchangeChain currenFastestChain, IExchangeChain newChain)
 {
     currenFastestChain = currenFastestChain ?? newChain; // First chain available
     return(newChain != null && newChain.IsFasterThan(currenFastestChain)
          ? newChain
          : currenFastestChain);
 }
Пример #2
0
 /// <summary>
 /// Indicate if specified chain a less part involve than current
 /// </summary>
 /// <param name="otherChain">Other chain to compare</param>
 /// <returns>True if current is faster than specified, false else</returns>
 public bool IsFasterThan(IExchangeChain otherChain)
 {
     if (otherChain == null)
     {
         return(true);
     }
     return(CountPartInvolve < otherChain.CountPartInvolve);
 }