mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-26 10:11:03 +00:00
([Array -empty]): Renamed from _empty, and implemented to do entire
job of emptying. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1148 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
33c40174bc
commit
93ea2042f2
1 changed files with 9 additions and 2 deletions
|
@ -25,6 +25,7 @@
|
|||
#include <objects/ArrayPrivate.h>
|
||||
#include <objects/NSString.h>
|
||||
#include <objects/OrderedCollection.h>
|
||||
#include <objects/behavior.h>
|
||||
|
||||
@implementation ConstantArray
|
||||
|
||||
|
@ -140,12 +141,18 @@
|
|||
[self initWithCapacity: c];
|
||||
for (i = 0; i < c; i++)
|
||||
[self insertObject: objs[i] atIndex: i]; // xxx this most efficient method?
|
||||
return self;
|
||||
}
|
||||
|
||||
/* This must work without sending any messages to content objects */
|
||||
- (void) _empty
|
||||
- (void) empty
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < _count; i++)
|
||||
[_contents_array[i] release];
|
||||
_count = 0;
|
||||
/* Note this may not work for subclassers. Beware. */
|
||||
}
|
||||
|
||||
// MANAGING CAPACITY;
|
||||
|
|
Loading…
Reference in a new issue