From 3b251b8e3d4dc9a694ef76562b388ab07da54785 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 13 Dec 2014 19:48:41 +0100 Subject: Replace some NSDictionaries with literals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [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). --- Source/SPBundleCommandTextView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/SPBundleCommandTextView.m') diff --git a/Source/SPBundleCommandTextView.m b/Source/SPBundleCommandTextView.m index 4ca63451..9a2d2ba8 100644 --- a/Source/SPBundleCommandTextView.m +++ b/Source/SPBundleCommandTextView.m @@ -377,7 +377,7 @@ NSInteger tabStopWidth = [prefs integerForKey:SPCustomQueryEditorTabStopWidth]; if(tabStopWidth < 1) tabStopWidth = 1; - float tabWidth = NSSizeToCGSize([@" " sizeWithAttributes:[NSDictionary dictionaryWithObject:tvFont forKey:NSFontAttributeName]]).width; + float tabWidth = NSSizeToCGSize([@" " sizeWithAttributes:@{NSFontAttributeName : tvFont}]).width; tabWidth = (float)tabStopWidth * tabWidth; NSInteger numberOfTabs = 256/tabStopWidth; -- cgit v1.2.3