From 93ea2042f280ae1bb579b74f8f78fded0cd52cd8 Mon Sep 17 00:00:00 2001 From: mccallum Date: Mon, 18 Mar 1996 13:40:54 +0000 Subject: [PATCH] ([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 --- Source/Array.m | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Source/Array.m b/Source/Array.m index 747963dcd..d4816e71a 100644 --- a/Source/Array.m +++ b/Source/Array.m @@ -25,6 +25,7 @@ #include #include #include +#include @implementation ConstantArray @@ -139,13 +140,19 @@ int i; [self initWithCapacity: c]; 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 */ -- (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;