[dmd-beta] D2 2.058 beta 4

Jacob Carlborg doob at me.com
Mon Feb 13 23:16:50 PST 2012



On 13 Feb, 2012,at 10:51 PM, Steve Schveighoffer <schveiguy at yahoo.com> wrote:

> This can be any number of things.  It seems like a corruption issue.
>
>
> Just for your info, however, the code you quoted below is wasteful -- Starting with 2.041 or around there, the code you give will allocate a new array, then throw it away on the first append.
>
> You are better off with this:
>
> Attribute[] attrs;
> attrs.reserve(tag.attr.length);
>
> No, I don't think this will solve your problem.  But it should avoid the throw-away initial array allocation.
>
>
> -Steve
 
That was the first thing I tried when I found the correct method, actually I tried to not reserve anything. This is an old habit from D1 I have. Since this project supports both D1 and D2 I used the old D1 version. But now when I think about it that code is only for D2 so I should changed that.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/dmd-beta/attachments/20120214/8faf3b78/attachment.html>


More information about the dmd-beta mailing list