From a21dcab37d395938185a31f3aefa27b4f36a9085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Luka=C5=A1=C3=ADk?= Date: Fri, 8 Sep 2023 23:40:54 +0200 Subject: [PATCH] perf: use URI::DEFAULT_PARSER instead of URI::Parser.new MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Lukašík --- lib/fluent/plugin/buffer/file_single_chunk.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/fluent/plugin/buffer/file_single_chunk.rb b/lib/fluent/plugin/buffer/file_single_chunk.rb index 7225438af6..4cc9d6c625 100644 --- a/lib/fluent/plugin/buffer/file_single_chunk.rb +++ b/lib/fluent/plugin/buffer/file_single_chunk.rb @@ -238,17 +238,16 @@ def file_rename(file, old_path, new_path, callback = nil) callback.call(file) if callback end - URI_PARSER = URI::Parser.new ESCAPE_REGEXP = /[^-_.a-zA-Z0-9]/n def encode_key(metadata) k = @key ? metadata.variables[@key] : metadata.tag k ||= '' - URI_PARSER.escape(k, ESCAPE_REGEXP) + URI::DEFAULT_PARSER.escape(k, ESCAPE_REGEXP) end def decode_key(key) - URI_PARSER.unescape(key) + URI::DEFAULT_PARSER.unescape(key) end def create_new_chunk(path, metadata, perm)