Skip to content

Commit

Permalink
MemoryIO to IO::Memory (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbrand authored and asterite committed Nov 27, 2016
1 parent 4fe8d6a commit 552ef24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion spec/protocol_spec.cr
Expand Up @@ -5,7 +5,7 @@ describe MySql::Protocol do
it "should write/read LengthEncodedInteger: {{number}}" do
DB.open "mysql://root@localhost" do |db|
db.using_connection do |connection|
content = MemoryIO.new
content = IO::Memory.new

# fake header with a 255 packet size
content.write_bytes(0xFF_u8, IO::ByteFormat::LittleEndian)
Expand Down
4 changes: 2 additions & 2 deletions src/mysql/connection.cr
Expand Up @@ -62,11 +62,11 @@ class MySql::Connection < DB::Connection

# :nodoc:
def write_packet(seq = 0)
content = MemoryIO.new
content = IO::Memory.new
yield WritePacket.new(content, self)
bytesize = content.bytesize

packet = MemoryIO.new
packet = IO::Memory.new
3.times do
packet.write_byte (bytesize & 0xff_u8).to_u8
bytesize >>= 8
Expand Down

0 comments on commit 552ef24

Please sign in to comment.