Date: prev next · Thread: first prev next last
2014 Archives by date, by thread · List index


Hi Julien,

On Sat, Mar 22, 2014 at 06:47:05AM -0700, julien2412 <serval2412@yahoo.fr> wrote:
The [] operator is to retrieve the nth element of the sorted vector. I don't
figure out how map would replace vector here? What key to use?

Nah, you just mentioned in general, that you would need a set (which is
a sorted container where the key is not separated from the value) which
has an operator[], and I believe map is just that.

Above all, do you think it worths it to spend some time on searching a way
to replace the vector implementation or am I misleading? I must recognize
it's just some guessing, I haven't profiled anything.

First, if you want to improve performance, then please always profile,
premature optimization just makes the code more complex without too much
benefits. :-)

Second, the logic to decide how to sort an SwSortedObj seems to be
ObjAnchorOrder (sw/source/core/layout/sortedobjs.cxx), if you want to
replace SwSortedObjs with something more generic, maybe use
o3tl::sorted_vector for this purpose?

That works quite well for e.g. SwRedlineTbl already.

Miklos

Attachment: signature.asc
Description: Digital signature


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.