mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
([NSGDictionaryObjectEnumerator -nextObject]): Return the key, not the
object. ([NSGDictionary -objectForKey:]): Method moved from NSGMutableDictionary. ([NSGMutableDictionary +initialize]): Don't use static variable in test. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1370 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
712b81db57
commit
ffdfa979d3
1 changed files with 12 additions and 15 deletions
|
@ -49,7 +49,8 @@
|
|||
- nextObject
|
||||
{
|
||||
id k;
|
||||
return [dictionary nextObjectAndKey: &k withEnumState: &enum_state];
|
||||
[dictionary nextObjectAndKey: &k withEnumState: &enum_state];
|
||||
return k;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
|
@ -80,7 +81,14 @@
|
|||
+ (void) initialize
|
||||
{
|
||||
if (self == [NSGDictionary class])
|
||||
class_add_behavior([NSGDictionary class], [Dictionary class]);
|
||||
behavior_class_add_class (self, [Dictionary class]);
|
||||
}
|
||||
|
||||
- objectForKey: aKey
|
||||
{
|
||||
/* xxx Should I change the method name in Dictionary?
|
||||
I don't really want to; I think "at" is better. */
|
||||
return [self objectAtKey: aKey];
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -99,12 +107,8 @@
|
|||
|
||||
+ (void) initialize
|
||||
{
|
||||
static int done = 0;
|
||||
if (!done)
|
||||
{
|
||||
done = 1;
|
||||
class_add_behavior([NSGMutableDictionary class], [NSGDictionary class]);
|
||||
}
|
||||
if (self == [NSGMutableDictionary class])
|
||||
behavior_class_add_class (self, [NSGDictionary class]);
|
||||
}
|
||||
|
||||
/* This is the designated initializer */
|
||||
|
@ -117,13 +121,6 @@
|
|||
[self putObject: anObject atKey: aKey];
|
||||
}
|
||||
|
||||
- objectForKey: aKey
|
||||
{
|
||||
/* xxx Should I change the method name in Dictionary?
|
||||
I don't really want to; I think "at" is better. */
|
||||
return [self objectAtKey: aKey];
|
||||
}
|
||||
|
||||
- (void) removeObjectForKey:(NSString *)aKey
|
||||
{
|
||||
[self removeObjectAtKey: aKey];
|
||||
|
|
Loading…
Reference in a new issue