mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Disambiguate methods in classes and protocols ... use the class version.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22113 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
fa19407f5a
commit
39e544280e
1 changed files with 21 additions and 3 deletions
|
@ -709,14 +709,32 @@ setDirectory(NSMutableDictionary *dict, NSString *path)
|
|||
}
|
||||
if (*u == nil)
|
||||
{
|
||||
NSEnumerator *e;
|
||||
NSString *unit;
|
||||
unsigned count = 0;
|
||||
|
||||
/**
|
||||
* If the method was given no unit to look in, then it will succeed
|
||||
* and return a value if (and only if) the required reference is
|
||||
* defined only in one unit.
|
||||
* defined only in one unit (excluding protocols).
|
||||
* In the case where it is in two units (one of them a protocol)
|
||||
* the class is taken in preference to the protocol.
|
||||
*/
|
||||
if ([t count] == 1)
|
||||
e = [t keyEnumerator];
|
||||
while ((unit = [e nextObject]) != nil)
|
||||
{
|
||||
*u = unit;
|
||||
if ([unit hasPrefix: @"("] == NO)
|
||||
{
|
||||
if (count++ > 0)
|
||||
{
|
||||
*u = nil; // More than one match
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (*u != nil)
|
||||
{
|
||||
*u = [[t allKeys] lastObject];
|
||||
return [t objectForKey: *u];
|
||||
}
|
||||
return nil;
|
||||
|
|
Loading…
Reference in a new issue