@@ -40,12 +40,11 @@ + (instancetype)dataWithCapacity: (size_t)capacity { return [[[self alloc] initWithCapacity: capacity] autorelease]; } -+ (instancetype)dataWithItemSize: (size_t)itemSize - capacity: (size_t)capacity ++ (instancetype)dataWithItemSize: (size_t)itemSize capacity: (size_t)capacity { return [[[self alloc] initWithItemSize: itemSize capacity: capacity] autorelease]; } @@ -81,12 +80,11 @@ { return [self initWithItemSize: 1 capacity: capacity]; } -- (instancetype)initWithItemSize: (size_t)itemSize - capacity: (size_t)capacity +- (instancetype)initWithItemSize: (size_t)itemSize capacity: (size_t)capacity { self = [super init]; @try { if (itemSize == 0) @@ -106,13 +104,11 @@ - (instancetype)initWithItems: (const void *)items count: (size_t)count itemSize: (size_t)itemSize { - self = [super initWithItems: items - count: count - itemSize: itemSize]; + self = [super initWithItems: items count: count itemSize: itemSize]; _capacity = _count; return self; } @@ -120,13 +116,11 @@ - (instancetype)initWithItemsNoCopy: (void *)items count: (size_t)count itemSize: (size_t)itemSize freeWhenDone: (bool)freeWhenDone { - self = [self initWithItems: items - count: count - itemSize: itemSize]; + self = [self initWithItems: items count: count itemSize: itemSize]; if (freeWhenDone) free(items); return self; @@ -194,20 +188,16 @@ memcpy(_items + _count * _itemSize, item, _itemSize); _count++; } -- (void)insertItem: (const void *)item - atIndex: (size_t)idx +- (void)insertItem: (const void *)item atIndex: (size_t)idx { - [self insertItems: item - atIndex: idx - count: 1]; + [self insertItems: item atIndex: idx count: 1]; } -- (void)addItems: (const void *)items - count: (size_t)count +- (void)addItems: (const void *)items count: (size_t)count { if (count > SIZE_MAX - _count) @throw [OFOutOfRangeException exception]; if (_count + count > _capacity) {