
4 Apr
2010
4 Apr
'10
7:38 p.m.
Hi, On 4. 4. 2010 21:35, Jeff Flinn wrote:
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?
Good point, makes sense. Regards, Pavol.