Andre Poenitz <[EMAIL PROTECTED]> writes: | On Tue, Mar 12, 2002 at 09:45:59AM +0100, Lars Gullik Bjønnes wrote: >> In the lyxtextclass senario there is little a conststring class could >> do... comparisons are O(n) on the string anyway. > | Worst case of course.
of course, and this is the case for all string classes. >> One further optimization, over that patch that I sent, is to use a >> hash_map if it exists. That would give O(1) lookup. > | I'd still say its overkill unless you show gprof figures... I only have for the "optimization" now. The Userguide certainly loads faster... >> There is also the possiblity of using a "tuning" lists, and list where >> often used items are moved forward, so that lookup is faster next time >> the same iterm is wanted, but is still O(n) in the general case. > | If we re-order the list we could simply sort it and use binary search, | couldn't we? a map you mean? (manual lists and binary search is just out.) and the whole point is to not reorder the list, the .layout file defines the order of the layouts. -- Lgb