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 From e201531daa71ee1a2e2a0f927c619947126c9d3d Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 4 Jan 2015 21:15:43 +0100 Subject: Addition to commit 2735e15b --- Source/SPBundleCommandTextView.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/SPBundleCommandTextView.m') diff --git a/Source/SPBundleCommandTextView.m b/Source/SPBundleCommandTextView.m index 9a2d2ba8..f8d4e53f 100644 --- a/Source/SPBundleCommandTextView.m +++ b/Source/SPBundleCommandTextView.m @@ -40,8 +40,8 @@ { [[NSNotificationCenter defaultCenter] removeObserver:self]; [prefs removeObserver:self forKeyPath:SPCustomQueryEditorTabStopWidth]; - [prefs release]; - [lineNumberView release]; + SPClear(prefs); + SPClear(lineNumberView); [super dealloc]; } -- cgit v1.2.3