private function canOmitKey($key, & $nextIndex)
    {
        $result = $key === $nextIndex;

        if (\is_int($key)) {
            $nextIndex = max($key + 1, $nextIndex);
        }

        return $result;
    }