Skip to content

Commit a90782d

Browse files
committed
♻️ Simplify CHARSET args in search_internal
1 parent a86ec0a commit a90782d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/net/imap.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3119,12 +3119,9 @@ def enforce_logindisabled?
31193119

31203120
def search_internal(cmd, keys, charset)
31213121
keys = normalize_searching_criteria(keys)
3122+
args = charset ? ["CHARSET", charset, *keys] : keys
31223123
synchronize do
3123-
if charset
3124-
send_command(cmd, "CHARSET", charset, *keys)
3125-
else
3126-
send_command(cmd, *keys)
3127-
end
3124+
send_command(cmd, *args)
31283125
clear_responses("SEARCH").last || []
31293126
end
31303127
end

0 commit comments

Comments
 (0)