Pinq\Iterators\Common\OrderedMap::remove PHP Method

remove() public method

{@inheritDoc}
public remove ( $key )
    public function remove($key)
    {
        $identityHash = Identity::hash($key);
        if (isset($this->keyIdentityPositionMap[$identityHash])) {
            $position = $this->keyIdentityPositionMap[$identityHash];
            unset($this->keys[$position], $this->values[$position], $this->keyIdentityPositionMap[$identityHash]);
            if ($position !== $this->length) {
                $this->keys = array_values($this->keys);
                $this->values = array_values($this->values);
            }
            $this->length--;
            if ($key === $this->largestIntKey) {
                $this->loadLargestIntKey();
            }
            return true;
        }
        return false;
    }