mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Fixed mutable dictionary keyed subscript behavior.
Assigning nil value via keyed subscript now correctly removes object for key.
This commit is contained in:
parent
23a887a973
commit
0547c53861
2 changed files with 14 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
2019-10-02 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Source/NSDictionary.m: fixed mutable dictionary keyed subscript
|
||||
behavior: assigning nil value via keyed subscript now correctly
|
||||
removes object for key.
|
||||
|
||||
2019-09-25 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Headers/Foundation/NSProcessInfo.h:
|
||||
|
|
|
@ -1350,7 +1350,14 @@ compareIt(id o1, id o2, void* context)
|
|||
|
||||
- (void) setObject: (id)anObject forKeyedSubscript: (id)aKey
|
||||
{
|
||||
[self setObject: anObject forKey: aKey];
|
||||
if (anObject == nil)
|
||||
{
|
||||
[self removeObjectForKey: aKey];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self setObject: anObject forKey: aKey];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue