mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
Slight performance improvement (better hash), plus tweaks for 64bit processors
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20275 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
178c64a8a5
commit
7c7c90b89c
2 changed files with 15 additions and 12 deletions
|
@ -219,14 +219,14 @@ static NSMapTable *attrNames = 0;
|
|||
{
|
||||
NSMapEnumerator enumerator;
|
||||
NSString *val;
|
||||
int key;
|
||||
void *key;
|
||||
|
||||
enumerator = NSEnumerateMapTable(attrNames);
|
||||
while (NSNextMapEnumeratorPair(&enumerator, (void**)&key, (void**)&val))
|
||||
while (NSNextMapEnumeratorPair(&enumerator, &key, (void**)&val))
|
||||
{
|
||||
if ([desc isEqual: val] == YES)
|
||||
{
|
||||
return key;
|
||||
return (int)key;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
|
@ -391,7 +391,7 @@ static NSMapTable *attrNames = 0;
|
|||
|
||||
- (unsigned) hash
|
||||
{
|
||||
return (unsigned)lib;
|
||||
return (((unsigned)lib) >> 3);
|
||||
}
|
||||
|
||||
- (id) init
|
||||
|
@ -568,14 +568,14 @@ static NSMapTable *nsNames = 0;
|
|||
{
|
||||
NSMapEnumerator enumerator;
|
||||
NSString *val;
|
||||
int key;
|
||||
void *key;
|
||||
|
||||
enumerator = NSEnumerateMapTable(nsNames);
|
||||
while (NSNextMapEnumeratorPair(&enumerator, (void**)&key, (void**)&val))
|
||||
while (NSNextMapEnumeratorPair(&enumerator, &key, (void**)&val))
|
||||
{
|
||||
if ([desc isEqual: val] == YES)
|
||||
{
|
||||
return key;
|
||||
return (int)key;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
|
@ -594,7 +594,7 @@ static NSMapTable *nsNames = 0;
|
|||
|
||||
- (unsigned) hash
|
||||
{
|
||||
return (unsigned)lib;
|
||||
return (((unsigned)lib) >> 3);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -795,14 +795,14 @@ static NSMapTable *nodeNames = 0;
|
|||
{
|
||||
NSMapEnumerator enumerator;
|
||||
NSString *val;
|
||||
int key;
|
||||
void *key;
|
||||
|
||||
enumerator = NSEnumerateMapTable(nodeNames);
|
||||
while (NSNextMapEnumeratorPair(&enumerator, (void**)&key, (void**)&val))
|
||||
while (NSNextMapEnumeratorPair(&enumerator, &key, (void**)&val))
|
||||
{
|
||||
if ([desc isEqual: val] == YES)
|
||||
{
|
||||
return key;
|
||||
return (int)key;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
|
@ -1053,7 +1053,7 @@ static NSMapTable *nodeNames = 0;
|
|||
|
||||
- (unsigned) hash
|
||||
{
|
||||
return (unsigned)lib;
|
||||
return (((unsigned)lib) >> 3);
|
||||
}
|
||||
|
||||
- (id) init
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue