aboutsummaryrefslogtreecommitdiffstats
path: root/lib/plum/hpack/huffman.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/plum/hpack/huffman.rb')
-rw-r--r--lib/plum/hpack/huffman.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/plum/hpack/huffman.rb b/lib/plum/hpack/huffman.rb
index 8fcc120..9604f1f 100644
--- a/lib/plum/hpack/huffman.rb
+++ b/lib/plum/hpack/huffman.rb
@@ -9,7 +9,7 @@ module Plum
# Static-Huffman-encodes the specified String.
def encode(bytestr)
- out = String.new
+ out = "".b
bytestr.each_byte do |b|
out << HUFFMAN_TABLE[b]
end
@@ -21,7 +21,7 @@ module Plum
def decode(encoded)
bits = encoded.unpack("B*")[0]
out = []
- buf = String.new
+ buf = "".b
bits.each_char do |cb|
buf << cb
if c = HUFFMAN_TABLE_INVERSED[buf]