File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ internal extension String {
6565
6666 var hasProcessedNewLines = false
6767 var specialCharState : ( UnicodeScalar , Int ) ? = nil /* First element is the special char, the other is the number of octothorps found. */
68- let ascii = unicodeScalars . lazy . map { scalar in
68+ let ascii = unicodeScalars . lazy . map { scalar -> String in
6969 /* Let’s build the previous escape if needed. */
7070 let prefix : String
7171 if scalar == " # " {
@@ -115,7 +115,9 @@ internal extension String {
115115 return prefix + ( octothorpLevel == 0 ? escaped : escaped. replacingOccurrences ( of: #"\"# , with: #"\"# + octothorps, options: . literal) )
116116 }
117117 }
118- return ( sepOpen + ascii. joined ( separator: " " ) + ( specialCharState. flatMap { String ( $0. 0 ) + String( repeating: " # " , count: $0. 1 ) } ?? " " ) + sepClose, hasProcessedNewLines)
118+ let asciiJoined = ascii. joined ( separator: " " )
119+ let specialCharStateMapped = ( specialCharState. flatMap { String ( $0. 0 ) + String( repeating: " # " , count: $0. 1 ) } ?? " " )
120+ return ( sepOpen + asciiJoined + specialCharStateMapped + sepClose, hasProcessedNewLines)
119121 }
120122
121123 private static let newLines = CharacterSet . newlines
You can’t perform that action at this time.
0 commit comments