From 53f79f85eb2f8a64e28d9544267f9a8c445e0fbf Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 8 Aug 2024 11:37:13 +0900 Subject: [PATCH] Don't call URI::RFC2396_Parser.new again --- mustermann/lib/mustermann/ast/translator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mustermann/lib/mustermann/ast/translator.rb b/mustermann/lib/mustermann/ast/translator.rb index c6efc66..cee8d97 100644 --- a/mustermann/lib/mustermann/ast/translator.rb +++ b/mustermann/lib/mustermann/ast/translator.rb @@ -118,7 +118,7 @@ def decorator_for(node) # @return [String] escaped character # @!visibility private - def escape(char, parser: URI::RFC2396_PARSER, escape: URI::RFC2396_Parser.new.regexp[:UNSAFE], also_escape: nil) + def escape(char, parser: URI::RFC2396_PARSER, escape: URI::RFC2396_PARSER.regexp[:UNSAFE], also_escape: nil) escape = Regexp.union(also_escape, escape) if also_escape char.to_s =~ escape ? parser.escape(char, Regexp.union(*escape)) : char end