103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
-
-
|
count = _array.count;
for (size_t i = 0; i < count; i++) {
if ([objects[i] isEqual: oldObject]) {
[newObject retain];
[objects[i] release];
objects[i] = newObject;
return;
}
}
}
- (void)replaceObjectAtIndex: (size_t)idx withObject: (id)object
{
id *objects;
|
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
|
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
-
+
-
+
+
+
-
+
+
|
@throw [OFInvalidArgumentException exception];
objects = _array.items;
count = _array.count;
for (size_t i = 0; i < count; i++) {
if ([objects[i] isEqual: object]) {
object = objects[i];
id tmp = objects[i];
[_array removeItemAtIndex: i];
_mutations++;
[object release];
[tmp release];
objects = _array.items;
i--;
return;
count--;
continue;
}
}
}
- (void)removeObjectIdenticalTo: (id)object
{
id const *objects;
|
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
|
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
|
+
+
-
+
+
|
for (size_t i = 0; i < count; i++) {
if (objects[i] == object) {
[_array removeItemAtIndex: i];
_mutations++;
[object release];
objects = _array.items;
i--;
return;
count--;
continue;
}
}
}
- (void)removeObjectAtIndex: (size_t)idx
{
#ifndef __clang_analyzer__
|