mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
Merge pull request #75 from triplef/fix-nsmutabledictionary-subscript
Fixed mutable dictionary keyed subscript behavior.
This commit is contained in:
commit
2d0f6849d6
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