mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 12:34:21 +00:00
For open_timeout support detection, the previous implementation relied on an ArgumentError being raised and then rescued. In Ruby, rescue is a rather expensive operation and should be avoided when possible. This patch reduces the number of begin-rescues by remembering if the TCPSocket implementation supports open_timeout. https://github.com/ruby/net-http/commit/06d982f3a1