Skip to content

Commit

Permalink
Updates MemoryStream.reserve DDOC
Browse files Browse the repository at this point in the history
Removes ambiguity as to whether `reserve` is relative to the entire stream or the cursor position.
  • Loading branch information
Daniel Cousens authored and Daniel Cousens committed Oct 27, 2013
1 parent f9712aa commit 18b0a17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion std/stream.d
Expand Up @@ -2675,7 +2675,7 @@ class MemoryStream: TArrayStream!(ubyte[]) {
this(byte[] buf) { this(cast(ubyte[]) buf); } /// ditto
this(char[] buf) { this(cast(ubyte[]) buf); } /// ditto

/// Ensure the stream can hold count bytes.
/// Ensure the stream can write count extra bytes from cursor position without an allocation.
void reserve(size_t count) {
if (cur + count > buf.length)
buf.length = cast(uint)((cur + count) * 2);
Expand Down

0 comments on commit 18b0a17

Please sign in to comment.