Skip to content

Commit

Permalink
serialize
Browse files Browse the repository at this point in the history
  • Loading branch information
dushibaiyu committed Aug 7, 2017
1 parent e326881 commit ef2e8fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/yu/tools/serialize/read.d
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct ReadStream
@disable this();
@disable this(this);

this(ubyte[] data)
this(const(ubyte)[] data)
{
_data = data;
}
Expand Down Expand Up @@ -182,9 +182,9 @@ struct ReadStream
uint len = startReadArray();
size_t start = _currt;
_currt += len;
ubyte[] data = _data[start.._currt];
auto data = _data[start.._currt];
endReadArray();
return data;
return cast(ubyte[])data;
}

string read(X: string)()
Expand All @@ -195,7 +195,7 @@ struct ReadStream
uint len = startReadArray();
size_t start = _currt;
_currt += len;
ubyte[] data = _data[start.._currt];
auto data = _data[start.._currt];
endReadArray();
return cast(string)data;
}
Expand Down Expand Up @@ -314,7 +314,7 @@ private:
endReadStruct();
}
private:
ubyte[] _data;
const(ubyte)[] _data;
size_t _currt;

StatusStack _status;
Expand Down
4 changes: 2 additions & 2 deletions src/yu/tools/serialize/write.d
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct WriteStream
@disable this();
@disable this(this);

this(IBuffer buffer)
this(IWriteBuffer buffer)
{
_buffer = buffer;
}
Expand Down Expand Up @@ -222,6 +222,6 @@ private:
}

private:
IBuffer _buffer;
IWriteBuffer _buffer;
StatusStack _status;
}

0 comments on commit ef2e8fc

Please sign in to comment.