mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +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
1bf4c4c303
commit
fc0a2b7fc9
1 changed files with 21 additions and 3 deletions
|
@ -709,14 +709,32 @@ setDirectory(NSMutableDictionary *dict, NSString *path)
|
||||||
}
|
}
|
||||||
if (*u == nil)
|
if (*u == nil)
|
||||||
{
|
{
|
||||||
|
NSEnumerator *e;
|
||||||
|
NSString *unit;
|
||||||
|
unsigned count = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the method was given no unit to look in, then it will succeed
|
* 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
|
* 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 [t objectForKey: *u];
|
||||||
}
|
}
|
||||||
return nil;
|
return nil;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue