File tree Expand file tree Collapse file tree
Tool/Sources/SuggestionModel Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ public extension String {
77 /// will be in the end of the string.
88 ///
99 /// For other situations, we can assume that they are "\n".
10- var lineEnding : Character ? {
10+ var lineEnding : Character {
1111 if let last, last. isNewline { return last }
1212 return " \n "
1313 }
@@ -17,7 +17,7 @@ public extension String {
1717 fast: Bool = true
1818 ) -> [ Substring ] {
1919 if fast {
20- let lineEndingInText = lineEnding ?? " \n "
20+ let lineEndingInText = lineEnding
2121 return split (
2222 separator: lineEndingInText,
2323 omittingEmptySubsequences: omittingEmptySubsequences
@@ -34,7 +34,7 @@ public extension String {
3434 proposedLineEnding: String ? = nil ,
3535 appendLineBreakToLastLine: Bool = false
3636 ) -> [ String ] {
37- let lineEndingInText = lineEnding ?? " \n "
37+ let lineEndingInText = lineEnding
3838 let lineEnding = proposedLineEnding ?? String ( lineEndingInText)
3939 // Split on character for better performance.
4040 let lines = split ( separator: lineEndingInText, omittingEmptySubsequences: false )
You can’t perform that action at this time.
0 commit comments