icecave / collections

A PHP collection library loosely inspired by the .NET runtime and the C++ STL. [DEPRECATED]
MIT License
70 stars 2 forks source link

Implement 'fast' range inserts for random access collections. #48

Closed jmalloc closed 11 years ago

jmalloc commented 11 years ago
    /**
     * Insert a sub-range of another collection's elements at a particular index.
     *
     * @param integer               $index    The index at which the elements are inserted, if index is a negative number the elements are inserted that far from the end of the sequence.
     * @param RandomAccessInterface $elements The collection from which the elements are copied.
     * @param integer               $begin    The index of the first element from $elements to insert, if begin is a negative number the removal begins that far from the end of the sequence.
     * @param integer               $end      The index of the last element to $elements to insert, if end is a negative number the removal ends that far from the end of the sequence.
     *
     * @throws Exception\IndexException if $index, $begin or $end is out of range.
     */
    public function insertRange($index, RandomAccessInterface $elements, $begin, $end);
jmalloc commented 11 years ago

Fixed in 3a2e9ff