Add comments to avoid confusion.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28390 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2009-07-11 14:02:00 +00:00
parent bcf438e21a
commit 974a65cb15
5 changed files with 84 additions and 27 deletions

View file

@ -486,10 +486,18 @@ NSEndMapTableEnumeration(NSMapEnumerator *enumerator)
}
if (enumerator->map != 0)
{
/* The 'map' field is non-null, so this NSMapEnumerator is actually
* a GSIMapEnumerator.
*/
GSIMapEndEnumerator((GSIMapEnumerator)enumerator);
}
else if (enumerator->node != 0)
{
/* The 'map' field is null but the 'node' field is not, so the
* NSMapEnumerator structure actually contains an NSEnumerator
* in the 'node' field, and the map table being enumerated in the
* 'bucket' field.
*/
[(id)enumerator->node release];
memset(enumerator, '\0', sizeof(GSIMapEnumerator));
}
@ -838,6 +846,10 @@ NSNextMapEnumeratorPair(NSMapEnumerator *enumerator,
{
GSIMapNode n;
/* The 'map' field is non-null, so this NSMapEnumerator is actually
* a GSIMapEnumerator and we can use the GSIMap... functions to work
* with it.
*/
n = GSIMapEnumeratorNextNode((GSIMapEnumerator)enumerator);
if (n == 0)
{
@ -867,8 +879,14 @@ NSNextMapEnumeratorPair(NSMapEnumerator *enumerator,
}
else if (enumerator->node != 0)
{
id k = [(NSEnumerator*)enumerator->node nextObject];
id k;
/* The 'map' field is null but the 'node' field is not, so the
* NSMapEnumerator structure actually contains an NSEnumerator
* in the 'node' field, and the map table being enumerated in the
* 'bucket' field.
*/
k = [(NSEnumerator*)enumerator->node nextObject];
if (k == nil)
{
return NO;