Skip to content

Commit

Permalink
Simplify string isAllWhitespace implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
LucianoPAlmeida committed Nov 8, 2021
1 parent 88a4aa9 commit 199737e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/XMLCoder/Auxiliaries/String+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ extension StringProtocol {

extension String {
func isAllWhitespace() -> Bool {
return self.trimmingCharacters(in: .whitespacesAndNewlines) == ""
return allSatisfy { $0.isNewline || $0.isWhitespace }
}
}

0 comments on commit 199737e

Please sign in to comment.