150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
|
id *cArray = [array cArray], *copy;
size_t i, count = [array count];
if (nObjects > count)
@throw [OFOutOfRangeException newWithClass: isa];
copy = [self allocMemoryForNItems: nObjects
withSize: sizeof(id)];
memcpy(copy, cArray + (count - nObjects), nObjects * sizeof(id));
@try {
[array removeNItems: nObjects];
mutations++;
for (i = 0; i < nObjects; i++)
|
|
|
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
|
id *cArray = [array cArray], *copy;
size_t i, count = [array count];
if (nObjects > count)
@throw [OFOutOfRangeException newWithClass: isa];
copy = [self allocMemoryForNItems: nObjects
ofSize: sizeof(id)];
memcpy(copy, cArray + (count - nObjects), nObjects * sizeof(id));
@try {
[array removeNItems: nObjects];
mutations++;
for (i = 0; i < nObjects; i++)
|
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
|
id *cArray = [array cArray], *copy;
size_t i, count = [array count];
if (range.length > count - range.start)
@throw [OFOutOfRangeException newWithClass: isa];
copy = [self allocMemoryForNItems: range.length
withSize: sizeof(id)];
memcpy(copy, cArray + range.start, range.length * sizeof(id));
@try {
[array removeNItems: range.length
atIndex: range.start];
mutations++;
|
|
|
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
|
id *cArray = [array cArray], *copy;
size_t i, count = [array count];
if (range.length > count - range.start)
@throw [OFOutOfRangeException newWithClass: isa];
copy = [self allocMemoryForNItems: range.length
ofSize: sizeof(id)];
memcpy(copy, cArray + range.start, range.length * sizeof(id));
@try {
[array removeNItems: range.length
atIndex: range.start];
mutations++;
|