Skip to content

Commit 1c20444

Browse files
Simplify closed body enumeration
Assisted-By: devx/b8194217-b20a-4799-b266-4910beb3ee2b
1 parent 16ac680 commit 1c20444

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎lib/protocol/rack/body/enumerable.rb‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,7 @@ def close(error = nil)
103103
# @yields {|chunk| ...}
104104
# @parameter chunk [String] A chunk of the response body.
105105
def each(&block)
106-
if body = @body
107-
body.each(&block)
108-
end
106+
@body&.each(&block)
109107
rescue => error
110108
raise
111109
ensure

0 commit comments

Comments
 (0)