phpstreams\operations\DistinctOperation::sortedIterator PHP Method

sortedIterator() private method

This method compares the current value to the previous value to decide on uniqueness.
private sortedIterator ( )
    private function sortedIterator()
    {
        $prev = null;
        $first = true;
        foreach ($this->source as $key => $value) {
            if ($first || $this->strict && $value !== $prev || !$this->strict && $value != $prev) {
                (yield $key => $value);
                $first = false;
                $prev = $value;
            }
        }
    }