sS regexpQuote_optimized(S s) {
  ret regexpLiteralNeedsQuoting(s) ? Pattern.quote(s) : s;
}