From 14b4933dbdf36fdc46d70f31829327cfdf98d6e9 Mon Sep 17 00:00:00 2001 From: mccallum Date: Mon, 28 Aug 1995 20:27:01 +0000 Subject: [PATCH] ([Collection -empty]): Check if already empty. This avoids a previous malloc(0). git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@591 72102866-910b-0410-8b05-ffd578937521 --- Source/Collection.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Collection.m b/Source/Collection.m index 104fba8ec..a1d27970d 100644 --- a/Source/Collection.m +++ b/Source/Collection.m @@ -97,6 +97,8 @@ send_release(elt e) /* May be inefficient. Could be overridden; */ - empty { + if ([self isEmpty]) + return self; if (CONTAINS_OBJECTS) [self _safeWithElementsCallNoRetain:send_release]; [self _empty];