[Libreoffice] [PATCH] ScColumn - convert array to vector

Noel Grandin noelgrandin at gmail.com
Fri Jan 13 10:36:04 PST 2012


Hi

Oh no!, I was testing some stuff and accidentally commented out the
critical line in ScColumn::Append().

This line
+//    aItems.resize(nSize);
should be
+    aItems.resize(nSize);

We could call reserve() on the vector to allocate extra capacity, but
I don't think there is any way to get exactly the same behaviour as
before in the ScColumn::Append() method.

I could add an extra method on ScColumn to reserve capacity, which
would be a more explicit way for the import process to prevent extra
re-allocation.


On Fri, Jan 13, 2012 at 17:54, Kohei Yoshida <kohei.yoshida at suse.com> wrote:
> On Fri, 2012-01-13 at 10:39 -0500, Kohei Yoshida wrote:
>> The only thing I'd like to check is that, I believe we had some sort
>> of
>> column array resizing policy which controls whether we should increase
>> its size only to the minimum necessary size or increase it to a size
>> larger than necessary to avoid future reallocation.  We do change this
>> policy sometimes during import which reduces import performance quite
>> a
>> bit.
>
> Yup, your change in ScColumn::Append() removes that policy.  Let me
> think about how we can preserve that behavior...
>
> Kohei
>
> --
> Kohei Yoshida, LibreOffice hacker, Calc
>
> _______________________________________________
> LibreOffice mailing list
> LibreOffice at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libreoffice


More information about the LibreOffice mailing list