mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
* Headers/GNUstepBase/GSIMap.h: Use GSI_MAP_NODE_IS_EMPTY macros
when checking in enumerator. * Source/NSConcreteHashTable.m, * Source/NSConcreteMapTable.m: Revert part of the weak pointer change.
This commit is contained in:
parent
834e915b6d
commit
d1cf30dd9f
4 changed files with 25 additions and 18 deletions
|
@ -627,13 +627,7 @@ NSNextHashEnumeratorItem(NSHashEnumerator *enumerator)
|
|||
}
|
||||
else
|
||||
{
|
||||
NSConcreteHashTable *map = enumerator->map;
|
||||
GSIMapKey k = GSI_MAP_READ_KEY(map, &n->key);
|
||||
if (k.ptr == NULL)
|
||||
{
|
||||
return NSNextHashEnumeratorItem(enumerator);
|
||||
}
|
||||
return k.ptr;
|
||||
return n->key.ptr;
|
||||
}
|
||||
}
|
||||
else if (enumerator->node != 0) // Got an enumerator object
|
||||
|
|
|
@ -882,17 +882,23 @@ NSNextMapEnumeratorPair(NSMapEnumerator *enumerator,
|
|||
}
|
||||
else
|
||||
{
|
||||
NSConcreteMapTable *map = enumerator->map;
|
||||
GSIMapKey k = GSI_MAP_READ_KEY(map, &n->key);
|
||||
GSIMapVal v = GSI_MAP_READ_VALUE(map, &n->value);
|
||||
if (k.ptr == NULL || v.ptr == NULL)
|
||||
{
|
||||
return NSNextMapEnumeratorPair(enumerator, key, value);
|
||||
if (key != 0)
|
||||
{
|
||||
*key = n->key.ptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
NSWarnFLog(@"Null key return address");
|
||||
}
|
||||
|
||||
*key = k.ptr;
|
||||
*value = v.ptr;
|
||||
|
||||
if (value != 0)
|
||||
{
|
||||
*value = n->value.ptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
NSWarnFLog(@"Null value return address");
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue