From b7916f7d31f61adc3b678303a5f6832a02cce91a Mon Sep 17 00:00:00 2001 From: Nate Weaver Date: Tue, 28 Apr 2020 17:03:43 -0500 Subject: [PATCH] Convert to an if-let since currentStyles are being stored instead of a single style --- Shared/Extensions/NSAttributedString+NetNewsWire.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Shared/Extensions/NSAttributedString+NetNewsWire.swift b/Shared/Extensions/NSAttributedString+NetNewsWire.swift index 749a8321c..bb2cc2821 100644 --- a/Shared/Extensions/NSAttributedString+NetNewsWire.swift +++ b/Shared/Extensions/NSAttributedString+NetNewsWire.swift @@ -172,12 +172,10 @@ extension NSAttributedString { let location = lastRange != nil ? lastRange!.location + lastRange!.length : 0 let range = NSRange(location: location, length: result.mutableString.length - location) - let style = Style(tag: tag) - attributeRanges.append( (range: range, styles: currentStyles) ) - if style != nil { - currentStyles.insert(style!) + if let style = Style(tag: tag) { + currentStyles.insert(style) } } else { if tag == "q" {