Skip to content

Commit

Permalink
Now also works on DMD master
Browse files Browse the repository at this point in the history
  • Loading branch information
lodo1995 committed Aug 21, 2016
1 parent 58d22ea commit 255caea
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 93 deletions.
12 changes: 10 additions & 2 deletions source/std/experimental/xml/appender.d
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,16 @@ struct Appender(T, Alloc)
else
delta = max(arr.length/2, requiredGrowth);

auto done = allocator.expandArray(arr, delta);
assert(done, "Could not grow appender array");
if (!arr.length)
{
arr = allocator.makeArray!(Unqual!T)(delta);
assert(arr, "Could not allocate array");
}
else
{
auto done = allocator.expandArray(arr, delta);
assert(done, "Could not grow appender array");
}
}

/**
Expand Down
Loading

0 comments on commit 255caea

Please sign in to comment.