gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSButtonImageSource weird code


From: Vincent R.
Subject: NSButtonImageSource weird code
Date: Wed, 10 Jul 2013 21:12:45 +0200
User-agent: Roundcube Webmail/0.6

Hi,

the following method of NSButtonImageSource looks weird :

NSMutableDictionary     *sources = nil;

+ (id) buttonImageSourceWithName: (NSString*)name
{
  NSButtonImageSource   *source;

  source = [sources objectForKey: name];
  if (source == nil)
    {
      source = [self alloc];
      source->imageName = [name copy];
      source->images = [NSMutableDictionary new];
      [sources setObject: source forKey: sources->imageName];
      RELEASE(source);
    }
  return source;
}

I think the line where the new object is added to the sources dictionary should be :

[sources setObject: source forKey: source->imageName];
instead of
[sources setObject: source forKey: sources->imageName];

What do you think ?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]