private static Adapter.OverloadCandidate FindBestCandidate( List <Adapter.OverloadCandidate> candidates, object[] arguments) { for (int index1 = 0; index1 < candidates.Count; ++index1) { int index2 = 0; while (index2 < candidates.Count && (index1 == index2 || Adapter.CompareMethods(candidates[index1], candidates[index2], arguments) > 0)) { ++index2; } if (index2 == candidates.Count) { return(candidates[index1]); } } return((Adapter.OverloadCandidate)null); }