On 2020/04/27 23:07:17, dak wrote: > On 2020/04/27 22:57:06, dak wrote: > > Move keytable init out of constructor. Frankly, I don't consider this an > > improvement. > > As anecdotal data, it took me about as long to get this working as the whole > other patch, and I had it segfault about half a dozen times and had another > half-dozen compiler errors while getting stuff right. > > And doc_hash_table, all_ifaces and option_hash are initialised in the same > manner as what I did in the previous patch version. And it's not like lexer > startup time is really going to factor in here a lot... The previous code > generated an individual key table for every single lexer (except for cloned > lexers). > > So without further feedback, I strongly lean towards pushing the previous > version.
Though I'd have no problems pulling out the initialisation into a _private_ static member function (can be called from the constructor obviously) if people consider it desirable to factor out that part of the initialisation. Does not need to access keytable_ but can just return the finished table. https://codereview.appspot.com/577840053/
