зеркало из https://github.com/github/bert.git
Merge pull request #6 from github/write-1-speed
speed up `write_1` calls
This commit is contained in:
Коммит
c489ecd510
|
@ -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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче