mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +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
d8a3ed9cba
commit
2352e05045
2 changed files with 10 additions and 6 deletions
|
@ -1,7 +1,8 @@
|
||||||
2008-06-07 Richard Frith-Macdonald <rfm@gnu.org>
|
2008-06-07 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/NSUserDefaults.m:
|
* 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>
|
2008-06-06 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
|
|
@ -1705,10 +1705,11 @@ static BOOL isLocked = NO;
|
||||||
{
|
{
|
||||||
if ((dict = (*pImp)(_persDomains, objectForKeySel, obj)) != nil
|
if ((dict = (*pImp)(_persDomains, objectForKeySel, obj)) != nil
|
||||||
|| (dict = (*tImp)(_tempDomains, objectForKeySel, obj)) != nil)
|
|| (dict = (*tImp)(_tempDomains, objectForKeySel, obj)) != nil)
|
||||||
(*addImp)(dictRep, addSel, dict);
|
{
|
||||||
|
(*addImp)(dictRep, addSel, dict);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_dictionaryRep = [dictRep copy];
|
_dictionaryRep = [dictRep makeImmutableCopyOnFail: NO];
|
||||||
RELEASE(dictRep);
|
|
||||||
}
|
}
|
||||||
rep = RETAIN(_dictionaryRep);
|
rep = RETAIN(_dictionaryRep);
|
||||||
[_lock unlock];
|
[_lock unlock];
|
||||||
|
@ -1872,9 +1873,11 @@ GSPrivateDefaultsFlag(GSUserDefaultFlagType type)
|
||||||
return flags[type];
|
return flags[type];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME ... Slightly faster than
|
/* Slightly faster than
|
||||||
* [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]
|
* [[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()
|
NSDictionary *GSPrivateDefaultLocale()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue