diff options
author | Max <post@wickenrode.com> | 2014-12-13 19:48:41 +0100 |
---|---|---|
committer | Max <post@wickenrode.com> | 2014-12-13 19:48:41 +0100 |
commit | 3b251b8e3d4dc9a694ef76562b388ab07da54785 (patch) | |
tree | 8ce5a4c4c637bab883ed7e6667bff7b5b74adbc3 /Source/SPNarrowDownCompletion.m | |
parent | 876dde21d97897ad4ee98aa0d6b11898282982ce (diff) | |
download | sequelpro-3b251b8e3d4dc9a694ef76562b388ab07da54785.tar.gz sequelpro-3b251b8e3d4dc9a694ef76562b388ab07da54785.tar.bz2 sequelpro-3b251b8e3d4dc9a694ef76562b388ab07da54785.zip |
Replace some NSDictionaries with literals
* [NSDictionary dictionary] → @{}
* [NSDictionary dictionaryWithObject:forKey:] can safely be replaced. object==nil would have already thrown a NPE in the past.
* Also replaced some (hopefully safe) NSArray initializers (ie. their objects should always exist).
Diffstat (limited to 'Source/SPNarrowDownCompletion.m')
-rw-r--r-- | Source/SPNarrowDownCompletion.m | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/SPNarrowDownCompletion.m b/Source/SPNarrowDownCompletion.m index 77ea9fbe..1b0128ca 100644 --- a/Source/SPNarrowDownCompletion.m +++ b/Source/SPNarrowDownCompletion.m @@ -294,7 +294,7 @@ for(NSUInteger i=0; i<maxLength; i++) [dummy appendString:@" "]; - CGFloat w = NSSizeToCGSize([dummy sizeWithAttributes:[NSDictionary dictionaryWithObject:tableFont forKey:NSFontAttributeName]]).width + 26.0f; + CGFloat w = NSSizeToCGSize([dummy sizeWithAttributes:@{NSFontAttributeName : tableFont}]).width + 26.0f; maxWindowWidth = (w>maxWindowWidth) ? maxWindowWidth : w; } else { maxWindowWidth = 220; @@ -712,7 +712,7 @@ closeMe = YES; return; } else { - [newFiltered addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"No item found", @"no item found message"), @"display", @"", @"noCompletion", nil]]; + [newFiltered addObject:@{@"display" : NSLocalizedString(@"No item found", @"no item found message"), @"noCompletion" : @""}]; } } } @@ -725,7 +725,7 @@ // if fetching db structure add dummy row for displaying that info on top of the list if(isQueryingDatabaseStructure) - [newFiltered insertObject:[NSDictionary dictionaryWithObjectsAndKeys:@"dummy", @"display", @"", @"noCompletion", nil] atIndex:0]; + [newFiltered insertObject:@{@"display" : @"dummy", @"noCompletion" : @""} atIndex:0]; NSPoint old = NSMakePoint([self frame].origin.x, [self frame].origin.y + [self frame].size.height); |