function unique( arr ) {
	var v;
	var i;
	var j;

	// Loop through the array, only incrementing a pointer when successive values are different. When a succeeding value is different, move the pointer and set the next value. In the trivial case where all array elements are unique, we incur a slight penalty in resetting the element value for each unique value. In other cases, we simply move a unique value to a new position in the array. The end result is a sorted array with unique values.
	for ( i = 1, j = 0; i < arr.length; i++ ) {
		v = arr[ i ];
		if ( arr[ j ] === v ) {
			debug( 'Found a duplicate package: %s.', v );
		} else {
			j += 1;
			arr[ j ] = v;
		}
	}
	// Truncate the array:
	arr.length = j+1;

	return arr;
}
Mutates a sorted input array to only contain unique values.

@private
@param {Array} arr - sorted array
@returns {Array} input array

@example
var arr = [ 'a', 'b', 'b', 'c' ];

var out = unique( arr );
// returns [ 'a', 'b', 'c' ]

var bool = ( arr === out );
// returns true