Re: [OpenBabel-Devel] [PATCH] Inefficient idiom with STL empty() and size()

2011-12-07 Thread Geoff Hutchison
> and so on. There was once a time I'd have fixed this is g++, but I'm > getting old. Hopefully, there's a willing volunteer to audit and fix the > source tree. Well, I got the low-hanging fruit with a "grep" test: % grep 'empty()' *.cpp | grep 'size()' The benefit of fixing this in our source

[OpenBabel-Devel] [PATCH] Inefficient idiom with STL empty() and size()

2011-12-07 Thread roger
This minor clean-up provides a negligible performance improvement to OBAtom::GetValence(), but addresses a commonly occurring but poor C++/STL programming idiom in the OpenBabel source tree. The inefficient idiom that's currently used looks like: return _vbond.empty() ? 0 : _vbond.size()