2 * An implementation of `_.uniq` optimized for sorted arrays without support
3 * for callback shorthands and `this` binding.
6 * @param {Array} array The array to inspect.
7 * @param {Function} [iteratee] The function invoked per iteration.
8 * @returns {Array} Returns the new duplicate free array.
10 function sortedUniq(array, iteratee) {
13 length = array.length,
17 while (++index < length) {
18 var value = array[index],
19 computed = iteratee ? iteratee(value, index, array) : value;
21 if (!index || seen !== computed) {
23 result[++resIndex] = value;
29 module.exports = sortedUniq;