
4 Apr
2010
4 Apr
'10
7:35 p.m.
In trying to get string algorithm icontains to work with spirit's file_iterator (which I still haven't been successful with) I noticed that the check for an empty search string is in side the loop. As: // Outer loop for(input_iterator_type OuterIt=Begin; OuterIt!=End; ++OuterIt) { // Sanity check if( boost::empty(m_Search) ) return result_type( End, End ); Wouldn't it be better to hoist this check out of the loop and only do it once? Thanks, Jeff