System.Threading.Timer.Scheduler.FindByDueTime C# (CSharp) 메소드

FindByDueTime() 개인적인 메소드

private FindByDueTime ( long nr ) : int
nr long
리턴 int
			int FindByDueTime (long nr)
			{
				int min = 0;
				int max = list.Count - 1;
				if (max < 0)
					return -1;

				if (max < 20) {
					while (min <= max) {
						Timer t = (Timer) list.GetByIndex (min);
						if (t.next_run == nr)
							return min;
						if (t.next_run > nr)
							return -1;
						min++;
					}
					return -1;
				}

				while (min <= max) {
					int half = min + ((max - min) >> 1);
					Timer t = (Timer) list.GetByIndex (half);
					if (nr == t.next_run)
						return half;
					if (nr > t.next_run)
						min = half + 1;
					else
						max = half - 1;
				}

				return -1;
			}