From 7a1cdd2c3d264266623f39ca5130090a5b1b36fa Mon Sep 17 00:00:00 2001 From: HoneyryderChuck Date: Sat, 2 Dec 2023 00:11:52 +0000 Subject: [PATCH] new rubocop, new needless linting... --- lib/httpx/chainable.rb | 2 +- lib/httpx/connection/http2.rb | 2 +- lib/httpx/plugins/proxy.rb | 3 +-- lib/httpx/transcoder.rb | 2 +- profiler/helpers.rb | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/httpx/chainable.rb b/lib/httpx/chainable.rb index a3f9453d..a440df96 100644 --- a/lib/httpx/chainable.rb +++ b/lib/httpx/chainable.rb @@ -71,7 +71,7 @@ module HTTPX return super unless option - with(option.to_sym => (args.first || options)) + with(option.to_sym => args.first || options) end def respond_to_missing?(meth, *) diff --git a/lib/httpx/connection/http2.rb b/lib/httpx/connection/http2.rb index 4a6a5df4..b4e82cf7 100644 --- a/lib/httpx/connection/http2.rb +++ b/lib/httpx/connection/http2.rb @@ -55,7 +55,7 @@ module HTTPX return :w end - unless (@connection.state == :connected && @handshake_completed) + unless @connection.state == :connected && @handshake_completed return @buffer.empty? ? :r : :rw end diff --git a/lib/httpx/plugins/proxy.rb b/lib/httpx/plugins/proxy.rb index 151979f8..7f89d5c1 100644 --- a/lib/httpx/plugins/proxy.rb +++ b/lib/httpx/plugins/proxy.rb @@ -236,9 +236,8 @@ module HTTPX end def send(request) - return super unless ( + return super unless @options.proxy && @state != :idle && connecting? - ) (@proxy_pending ||= []) << request end diff --git a/lib/httpx/transcoder.rb b/lib/httpx/transcoder.rb index e5564bd4..eb09b8ee 100644 --- a/lib/httpx/transcoder.rb +++ b/lib/httpx/transcoder.rb @@ -5,7 +5,7 @@ module HTTPX module_function def normalize_keys(key, value, cond = nil, &block) - if (cond && cond.call(value)) + if cond && cond.call(value) block.call(key.to_s, value) elsif value.respond_to?(:to_ary) if value.empty? diff --git a/profiler/helpers.rb b/profiler/helpers.rb index 27be8d01..366d9201 100644 --- a/profiler/helpers.rb +++ b/profiler/helpers.rb @@ -54,7 +54,7 @@ module ProfilerHelpers next_memsize = obj_memsize_proc.call - next_memsize.each do |klass, (count, size)| + next_memsize.each_key do |klass| prev_count, prev_size = prev_memsize[klass] current_count = count - prev_count next if current_count.zero?