@@ -173,14 +173,14 @@ _count++; } - (void)insertItem: (const void *)item - atIndex: (size_t)index + atIndex: (size_t)idx { [self insertItems: item - atIndex: index + atIndex: idx count: 1]; } - (void)addItems: (const void *)items count: (size_t)count @@ -198,33 +198,33 @@ memcpy(_items + _count * _itemSize, items, count * _itemSize); _count += count; } - (void)insertItems: (const void *)items - atIndex: (size_t)index + atIndex: (size_t)idx count: (size_t)count { - if (count > SIZE_MAX - _count || index > _count) + if (count > SIZE_MAX - _count || idx > _count) @throw [OFOutOfRangeException exception]; if (_count + count > _capacity) { _items = [self resizeMemory: _items size: _itemSize count: _count + count]; _capacity = _count + count; } - memmove(_items + (index + count) * _itemSize, - _items + index * _itemSize, (_count - index) * _itemSize); - memcpy(_items + index * _itemSize, items, count * _itemSize); + memmove(_items + (idx + count) * _itemSize, _items + idx * _itemSize, + (_count - idx) * _itemSize); + memcpy(_items + idx * _itemSize, items, count * _itemSize); _count += count; } -- (void)removeItemAtIndex: (size_t)index +- (void)removeItemAtIndex: (size_t)idx { - [self removeItemsInRange: of_range(index, 1)]; + [self removeItemsInRange: of_range(idx, 1)]; } - (void)removeItemsInRange: (of_range_t)range { if (range.length > SIZE_MAX - range.location ||