Skip to content

Commit 1e04616

Browse files
committed
StringFormatter: Removes redundant comments
1 parent 682b1cb commit 1e04616

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

WooCommerce/Classes/Tools/StringFormatter/StringFormatter.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ private extension StringFormatter {
6464
/// we use these so that the ranges are still in the right position, but the extra space basically disappears
6565
///
6666
let output = baseString
67-
.replacingOccurrences(of: "\t ", with: String.hairSpace + String.hairSpace) // tabs before a space
68-
.replacingOccurrences(of: " \t", with: String.space + String.hairSpace) // tabs after a space
69-
.replacingOccurrences(of: "\t@", with: String.hairSpace + "@") // tabs before @mentions
70-
.replacingOccurrences(of: "\t.", with: String.hairSpace + ".") // tabs before a space
71-
.replacingOccurrences(of: "\t,", with: String.hairSpace + ",") // tabs cefore a comman
72-
.replacingOccurrences(of: "\n\t\n\t", with: String.hairSpace + String.hairSpace + "\n\t") // extra newline-with-tab before a newline-with-tab
67+
.replacingOccurrences(of: "\t ", with: String.hairSpace + String.hairSpace)
68+
.replacingOccurrences(of: " \t", with: String.space + String.hairSpace)
69+
.replacingOccurrences(of: "\t@", with: String.hairSpace + "@")
70+
.replacingOccurrences(of: "\t.", with: String.hairSpace + ".")
71+
.replacingOccurrences(of: "\t,", with: String.hairSpace + ",")
72+
.replacingOccurrences(of: "\n\t\n\t", with: String.hairSpace + String.hairSpace + "\n\t")
7373

74-
// if the length of the string changes the range-based formatting will break
74+
// Failsafe: If the length of the string changes the range-based formatting will break
7575
guard output.count == baseString.count else {
7676
return baseString
7777
}

0 commit comments

Comments
 (0)