Skip to content

Commit

Permalink
ZeroOrMore implies Optionally so remove wrapper (#813)
Browse files Browse the repository at this point in the history
  • Loading branch information
bolsinga committed Jun 15, 2024
1 parent 5b9ff19 commit 4a8d5a0
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions Sources/Site/Utility/String+LibrarySorting.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ extension String {
var result = self.removeCommonInitialWords

let regex = Regex {
Optionally {
ZeroOrMore {
.word.inverted
}
}
ZeroOrMore { .word.inverted }
Capture {
OneOrMore {
.word
Expand All @@ -43,11 +39,7 @@ extension String {
}
}
}
Optionally {
ZeroOrMore {
.word.inverted
}
}
ZeroOrMore { .word.inverted }
}

if let match = result.wholeMatch(of: regex) {
Expand Down

0 comments on commit 4a8d5a0

Please sign in to comment.