mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 22:17:39 +00:00
Shallow copy for attributes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10099 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f77edb1d03
commit
3e4f05e940
2 changed files with 10 additions and 1 deletions
|
@ -84,7 +84,11 @@ cacheAttributes(NSDictionary *attrs)
|
|||
node = GSIMapNodeForKey(&attrMap, (GSIMapKey)attrs);
|
||||
if (node == 0)
|
||||
{
|
||||
attrs = [attrs copy];
|
||||
/*
|
||||
* Shallow copy of dictionary, without copying objects ... results
|
||||
* in an immutable dictionary that can safely be cached.
|
||||
*/
|
||||
attrs = [[NSDictionary alloc] initWithDictionary: attrs copyItems: NO];
|
||||
GSIMapAddPair(&attrMap, (GSIMapKey)attrs, (GSIMapVal)(unsigned)1);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue