Skip to content

Commit

Permalink
Use String.count directly
Browse files Browse the repository at this point in the history
  • Loading branch information
devxoul committed Nov 7, 2017
1 parent a95a7f3 commit 6a148b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/URLMatcher/URLMatcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ open class URLMatcher {

func replaceRegex(_ pattern: String, _ repl: String, _ string: String) -> String {
guard let regex = try? NSRegularExpression(pattern: pattern, options: []) else { return string }
let range = NSMakeRange(0, string.characters.count)
let range = NSMakeRange(0, string.count)
return regex.stringByReplacingMatches(in: string, options: [], range: range, withTemplate: repl)
}

Expand Down

0 comments on commit 6a148b7

Please sign in to comment.