3 Jan
2005
3 Jan
'05
8:45 p.m.
Bob Jamison wrote:
Ted & All,
I did a lot of searching/debugging/tracing & stuff, and it all came down to line 50 in db.cpp:
bool add_to_list=((*moduledict.find(module->get_id())).second == NULL);
EEEEEEEEEEEeeeeeeeeeeeeeeeeeeeeeeeeeeeeeekkkkkkkkkk!!!!!!!!
Scary, scary, scary code!
That's got a few of my pet-peeves, mainly the nestling of calls there. Sure, it saves a few lines in the source, but we're not working from punch-cards or teletypes any more.
Among other things, collapsing the get_id() and find() calls make it hard to debug. In general I recommend storing the results of get_id(), storing the result of find() and *then* checking second. Trust me, it does nothing to make the code run faster. :-)