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



On 2012-08-08 12:50, Michael Stahl wrote:
so it gets rid of Container, which is good. the UniqueIndex class used to be some kind of encoding of an associative array into an array, so using a std::map seems appropriate. but i think it would be even better to remove the UniqueIndex class completely
I would have done that, but there are 2 usages of it:

rsc/inc/rscdef.hxx:213:typedef UniqueIndex<RscFile> RscSubFileTab;
tools/inc/tools/pstm.hxx:152:typedef UniqueIndex<SvPersistBase> SvPersistUIdx;


, it appears that there are still remnants of the old array-mapping in e.g. UniqueIndexImpl::Insert that seem pointless, also the NextIndex() looks rather slow, just using map iterators directly would be faster. just compute the next key on inserting with something like rbegin()->first + 1 (check for empty() first), that could be a stand-alone function at the use site.

UniqueIndex is both a map and a key generator. It also tries to keep the key space as small as possible The key generating part appears to be quite necessary to how the RSC module functions.

Suggestions?

Disclaimer: http://www.peralex.com/disclaimer.html



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.