mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 17:10:48 +00:00
Minor optimisation for getting dictionary representation of defaults.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26604 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
62564278d7
commit
13fee270ce
2 changed files with 10 additions and 6 deletions
|
@ -1,7 +1,8 @@
|
|||
2008-06-07 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSUserDefaults.m:
|
||||
Fix possible deadlock reported by Larry Campbell
|
||||
Fix possible deadlock reported by Larry Campbell, and improve
|
||||
optimisation a little.
|
||||
|
||||
2008-06-06 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
|
|
|
@ -1705,10 +1705,11 @@ static BOOL isLocked = NO;
|
|||
{
|
||||
if ((dict = (*pImp)(_persDomains, objectForKeySel, obj)) != nil
|
||||
|| (dict = (*tImp)(_tempDomains, objectForKeySel, obj)) != nil)
|
||||
(*addImp)(dictRep, addSel, dict);
|
||||
{
|
||||
(*addImp)(dictRep, addSel, dict);
|
||||
}
|
||||
}
|
||||
_dictionaryRep = [dictRep copy];
|
||||
RELEASE(dictRep);
|
||||
_dictionaryRep = [dictRep makeImmutableCopyOnFail: NO];
|
||||
}
|
||||
rep = RETAIN(_dictionaryRep);
|
||||
[_lock unlock];
|
||||
|
@ -1872,9 +1873,11 @@ GSPrivateDefaultsFlag(GSUserDefaultFlagType type)
|
|||
return flags[type];
|
||||
}
|
||||
|
||||
/* FIXME ... Slightly faster than
|
||||
/* Slightly faster than
|
||||
* [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]
|
||||
* but is it really worthwile?
|
||||
* Avoiding the autorelease of the standard defaults turns out to be
|
||||
* a modest but significant gain when making heavy use of methods which
|
||||
* need localisation.
|
||||
*/
|
||||
NSDictionary *GSPrivateDefaultLocale()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue