Skip to content

Commit c00d937

Browse files
linting
1 parent 8c60349 commit c00d937

File tree

6 files changed

+9
-6
lines changed

6 files changed

+9
-6
lines changed

lib/http/2/framer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def read_common_header(buf)
185185
{
186186
type: type,
187187
flags: FRAME_FLAGS[type].filter_map do |name, pos|
188-
name if flags.anybits?((1 << pos))
188+
name if flags.anybits?(1 << pos)
189189
end,
190190
length: length,
191191
stream: stream & RBIT
@@ -359,7 +359,7 @@ def generate(frame)
359359
# Padding: Padding octets that contain no application semantic value.
360360
# Padding octets MUST be set to zero when sending and ignored when
361361
# receiving.
362-
append_str(bytes, ("\0" * padlen))
362+
append_str(bytes, "\0" * padlen)
363363
end
364364

365365
frame[:length] = length

lib/http/2/header/huffman.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module Huffman
2929
def encode(str, buffer = "".b)
3030
bitstring = String.new("", encoding: Encoding::BINARY, capacity: (str.bytesize * 30) + ((8 - str.size) % 8))
3131
str.each_byte { |chr| append_str(bitstring, ENCODE_TABLE[chr]) }
32-
append_str(bitstring, ("1" * ((8 - bitstring.size) % 8)))
32+
append_str(bitstring, "1" * ((8 - bitstring.size) % 8))
3333
pack([bitstring], "B*", buffer: buffer)
3434
end
3535

spec/connection_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
RSpec.describe HTTP2::Connection do
66
include FrameHelpers
7+
78
let(:conn) { Client.new }
89
let(:f) { Framer.new }
910

spec/emitter_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
RSpec.describe HTTP2::Emitter do
66
class Worker
77
include Emitter
8+
89
def initialize
910
@listeners = Hash.new { |hash, key| hash[key] = [] }
1011
end

spec/stream_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
RSpec.describe HTTP2::Stream do
66
include FrameHelpers
7+
78
let(:f) { Framer.new }
89
let(:client) { Client.new }
910
let(:stream) { client.new_stream }

tasks/generate_huffman_table.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def add(code, len, chr)
2828
if len.zero?
2929
@emit = chr
3030
else
31-
bit = code.nobits?((1 << (len - 1))) ? 0 : 1
31+
bit = code.nobits?(1 << (len - 1)) ? 0 : 1
3232
node = @next[bit] ||= Node.new(@depth + 1)
3333
node.add(code, len - 1, chr)
3434
end
@@ -70,7 +70,7 @@ def self.generate_machine
7070
n = node
7171
emit = "".b
7272
(BITS_AT_ONCE - 1).downto(0) do |i|
73-
bit = input.nobits?((1 << i)) ? 0 : 1
73+
bit = input.nobits?(1 << i) ? 0 : 1
7474
n = n.next[bit]
7575
next unless n.emit
7676

@@ -123,7 +123,7 @@ class Huffman
123123
id.times do |i|
124124
n = id_state[i]
125125
f.print " ["
126-
string = Array.new((1 << 4)) do |t|
126+
string = Array.new(1 << 4) do |t|
127127
transition = n.transitions.fetch(t)
128128
emit = transition.emit
129129
unless emit == EOS

0 commit comments

Comments
 (0)