diff --git a/re2/tostring.cc b/re2/tostring.cc index fc9faca45..278c31013 100644 --- a/re2/tostring.cc +++ b/re2/tostring.cc @@ -131,8 +131,7 @@ static void AppendLiteral(string *t, Rune r, bool foldcase) { t->append(1, '\\'); t->append(1, static_cast(r)); } else if (foldcase && 'a' <= r && r <= 'z') { - if ('a' <= r && r <= 'z') - r += 'A' - 'a'; + r -= 'a' - 'A'; t->append(1, '['); t->append(1, static_cast(r)); t->append(1, static_cast(r) + 'a' - 'A');