aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Regex.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2021-12-02 21:02:54 +0000
committerDimitry Andric <dim@FreeBSD.org>2021-12-02 21:02:54 +0000
commitf65dcba83ce5035ab88a85fe17628b447eb56e1b (patch)
tree35f37bb72b3cfc6060193e66c76ee7c9478969b0 /llvm/lib/Support/Regex.cpp
parent846a2208a8ab099f595fe7e8b2e6d54a7b5e67fb (diff)
Diffstat (limited to 'llvm/lib/Support/Regex.cpp')
-rw-r--r--llvm/lib/Support/Regex.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Support/Regex.cpp b/llvm/lib/Support/Regex.cpp
index 0d5cc1c00db1..7a804a1a2297 100644
--- a/llvm/lib/Support/Regex.cpp
+++ b/llvm/lib/Support/Regex.cpp
@@ -218,10 +218,10 @@ bool Regex::isLiteralERE(StringRef Str) {
std::string Regex::escape(StringRef String) {
std::string RegexStr;
- for (unsigned i = 0, e = String.size(); i != e; ++i) {
- if (strchr(RegexMetachars, String[i]))
+ for (char C : String) {
+ if (strchr(RegexMetachars, C))
RegexStr += '\\';
- RegexStr += String[i];
+ RegexStr += C;
}
return RegexStr;