mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 08:26:27 +00:00
([IndexedCollection -getNextElement:withEnumState:]): if isEmpty,
return NO. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@616 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8ad2e6c58f
commit
9cbd1255b9
1 changed files with 3 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
/* Implementation for Objective-C IndexedCollection object
|
||||
Copyright (C) 1993,1994 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993,1994, 1995 Free Software Foundation, Inc.
|
||||
|
||||
Written by: R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
|
||||
Date: May 1993
|
||||
|
@ -750,7 +750,8 @@
|
|||
- (BOOL) getNextElement:(elt *)anElementPtr withEnumState: (void**)enumState
|
||||
{
|
||||
/* *(unsigned*)enumState is the index of the element that will be returned */
|
||||
if ((*(unsigned*)enumState) > [self count]-1)
|
||||
if ([self isEmpty]
|
||||
|| (*(unsigned*)enumState) > [self count]-1)
|
||||
return NO;
|
||||
*anElementPtr = [self elementAtIndex:(*(unsigned*)enumState)];
|
||||
(*(unsigned*)enumState)++;
|
||||
|
|
Loading…
Reference in a new issue