([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:
mccallum 1996-03-18 13:40:54 +00:00
parent 33c40174bc
commit 93ea2042f2

View file

@ -25,6 +25,7 @@
#include <objects/ArrayPrivate.h> #include <objects/ArrayPrivate.h>
#include <objects/NSString.h> #include <objects/NSString.h>
#include <objects/OrderedCollection.h> #include <objects/OrderedCollection.h>
#include <objects/behavior.h>
@implementation ConstantArray @implementation ConstantArray
@ -140,12 +141,18 @@
[self initWithCapacity: c]; [self initWithCapacity: c];
for (i = 0; i < c; i++) for (i = 0; i < c; i++)
[self insertObject: objs[i] atIndex: i]; // xxx this most efficient method? [self insertObject: objs[i] atIndex: i]; // xxx this most efficient method?
return self;
} }
/* This must work without sending any messages to content objects */ /* 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; _count = 0;
/* Note this may not work for subclassers. Beware. */
} }
// MANAGING CAPACITY; // MANAGING CAPACITY;