From d723c6d9118840aff2f260b46698d15724d3fbf2 Mon Sep 17 00:00:00 2001 From: nick evans Date: Thu, 7 Nov 2024 14:03:24 -0500 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Simplify=20`CHARSET`=20arg?= =?UTF-8?q?s=20in=20`search=5Finternal`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/net/imap.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/net/imap.rb b/lib/net/imap.rb index 5bbfbe5e..fed9bd8b 100644 --- a/lib/net/imap.rb +++ b/lib/net/imap.rb @@ -2941,12 +2941,9 @@ def enforce_logindisabled? def search_internal(cmd, keys, charset) keys = normalize_searching_criteria(keys) + args = charset ? ["CHARSET", charset, *keys] : keys synchronize do - if charset - send_command(cmd, "CHARSET", charset, *keys) - else - send_command(cmd, *keys) - end + send_command(cmd, *args) clear_responses("SEARCH").last || [] end end