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