Possible change to array runtime?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Mar 13 10:20:33 PDT 2014


On 3/13/14, 10:18 AM, Steven Schveighoffer wrote:
> On Thu, 13 Mar 2014 12:29:59 -0400, Andrei Alexandrescu
> <SeeWebsiteForEmail at erdani.org> wrote:
>> I think there's a much simpler approach that could help. Define and
>> document a function clearForAppend that resets the length to 0 and
>> puts the array in gear for appending. Maybe an optional parameter
>> indicates a minimum desired capacity.
>>
>> Then people who want to migrate from D1 to D2 or generally consider
>> using this idiom can grep their source code for "length *= *0" and
>> make the change on their own pace and with appropriate testing.
>
> Arguably this is already possible within a project, such as
> Sociomantic's. They haven't done it yet. I don't know why.

Don?

Andrei




More information about the Digitalmars-d mailing list