Kees Cook wrote:
On Mon, Jan 03, 2005 at 12:45:36PM -0800, Jon A. Cruz wrote:
Scary, scary, scary code!
Yeah, my bad. I don't know stl very well yet.
Well, not really. Or at least not your 'bad'. That's just a very common coding practice.
Way too common for my tastes, but then again I can be known to get pedantic and/or opinionated now and then.
:-)
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. :-)
Can you go in there and fix it up the way it "should" be, and I can look at it when you're done?
I'll try to get to it this week. I'll also check against our coding style guides and make sure things are properly in there also. That's the main point about griping publically - gives some record and mention for helping others avoid subtle pitfalls.