Merge pull request #6 from github/write-1-speed

speed up `write_1` calls
This commit is contained in:
Brian Lopez 2016-08-11 08:56:45 -07:00 коммит произвёл GitHub
Родитель d6abc9afc0 63758fe5c6
Коммит c489ecd510
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -97,18 +97,18 @@ module BERT
def write_any_raw obj
case obj
when Symbol then write_symbol(obj)
when String then write_binary(obj)
when Fixnum, Bignum then write_fixnum(obj)
when Float then write_float(obj)
when Tuple then write_tuple(obj)
when Array then write_list(obj)
when String then write_binary(obj)
else
fail(obj)
end
end
def write_1(byte)
out.write([byte].pack("C"))
out.write(byte.chr)
end
def write_2(short)