Skip to content

Commit

Permalink
Prefer #size.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Aug 11, 2019
1 parent f81a11b commit ba59adc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/http2/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def stream.process_headers(frame)
def stream.receive_data(frame)
data = super

$count += data.scan(/kittens/).count
$count += data.scan(/kittens/).size

puts "Got response data: #{data.bytesize}"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/protocol/http2/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ def receive_headers(frame)
raise ProtocolError, "Invalid stream id: #{stream_id} <= #{@remote_stream_id}!"
end

if self.active_streams.count < self.maximum_concurrent_streams
if self.active_streams.size < self.maximum_concurrent_streams
stream = accept_stream(stream_id)
@remote_stream_id = stream_id

Expand Down
2 changes: 1 addition & 1 deletion lib/protocol/http2/flow_control.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def consume_window(size = self.available_size)
if !self.window_updated(size) and children = self.children
children = children.values.sort_by(&:weight)

# This must always be at least >= `children.count`, since stream weight can't be 0.
# This must always be at least >= `children.size`, since stream weight can't be 0.
total = children.sum(&:weight)

children.each do |child|
Expand Down
2 changes: 1 addition & 1 deletion spec/protocol/http2/settings_frame_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
it "packs settings" do
subject.pack settings

expect(subject.length).to be == 6*settings.count
expect(subject.length).to be == 6*settings.size
end
end

Expand Down

0 comments on commit ba59adc

Please sign in to comment.