Exemplo n.º 1
0
        /* Searches for an element in the buffer using the given scheme */
        private int search(CompareFlits compare)
        {
            int win = 0;

            if (buffer.Count == 0)
            {
                return(-1);
            }

            for (int i = 1; i < buffer.Count; i++)
            {
                if (0 < compare(buffer[win], buffer[i]))
                {
                    win = i;
                }
            }

            return(win);
        }
Exemplo n.º 2
0
		/* Searches for an element in the buffer using the given scheme */
		private int search(CompareFlits compare)
		{
			int win = 0;
			if (buffer.Count == 0) return -1;
			
			for(int i = 1; i < buffer.Count; i++)
				if(0 < compare(buffer[win], buffer[i]))
					win = i;
					
			return win;
		}