From 951ffeb899a726b98c737c161b8a767ff463625f Mon Sep 17 00:00:00 2001 From: Nate Weaver Date: Thu, 30 Apr 2020 12:11:52 -0500 Subject: [PATCH] Move declaration/initialization of attributes dictionary closer to use --- Shared/Extensions/NSAttributedString+NetNewsWire.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Shared/Extensions/NSAttributedString+NetNewsWire.swift b/Shared/Extensions/NSAttributedString+NetNewsWire.swift index 77435543d..67194fa7f 100644 --- a/Shared/Extensions/NSAttributedString+NetNewsWire.swift +++ b/Shared/Extensions/NSAttributedString+NetNewsWire.swift @@ -225,8 +225,6 @@ extension NSAttributedString { let currentDescriptor = currentFont.fontDescriptor var descriptor = currentDescriptor.copy() as! FontDescriptor - var attributes: [NSAttributedString.Key: Any] = [:] - var symbolicTraits = currentDescriptor.symbolicTraits if styles.contains(.bold) { @@ -262,6 +260,8 @@ extension NSAttributedString { descriptor = descriptor.addingAttributes(descriptorAttributes) } + var attributes = [NSAttributedString.Key: Any]() + attributes[.font] = Font(descriptor: descriptor, size: baseFont.pointSize) if styles.contains(.strikethrough) {