'use strict';

// MAIN //

/**
* Computes the minimum time.
*
* @private
* @param {ArrayArray} times - times
* @returns {NonNegativeIntegerArray} minimum time
*/
function min( times ) {
	var out;
	var t;
	var i;

	out = times[ 0 ];
	for ( i = 1; i < times.length; i++ ) {
		t = times[ i ];
		if (
			t[ 0 ] <= out[ 0 ] &&
			t[ 1 ] < out[ 1 ]
		) {
			out = t;
		}
	}
	return out;
} // end FUNCTION min()


// EXPORTS //

module.exports = min;

'use strict';

// MAIN //

/**
* Computes the minimum time.
*
* @private
* @param {ArrayArray} times - times
* @returns {NonNegativeIntegerArray} minimum time
*/
function min( times ) {
	var out;
	var t;
	var i;

	out = times[ 0 ];
	for ( i = 1; i < times.length; i++ ) {
		t = times[ i ];
		if (
			t[ 0 ] < out[ 0 ] ||
			(
				t[ 0 ] === out[ 0 ] &&
				t[ 1 ] < out[ 1 ]
			)
		) {
			out = t;
		}
	}
	return out;
} // end FUNCTION min()


// EXPORTS //

module.exports = min;

Fix bug when calculating minimum time
Fix bug when calculating minimum time
