On Sat, Apr 01, 2006 at 09:47:19AM +0200, Abdelrazak Younes wrote: > Martin Vermeer a écrit : > >On Sat, Apr 01, 2006 at 09:12:08AM +0200, Abdelrazak Younes wrote:
... > >>>> for (ParIterator it = par_iterator_begin(buf.inset()); it; ++it) { > >>>> > >>>What is the test doing in this for-loop? Shouldn't it be testing it != > >>>end, > >>>with end = par_iterator_end(buf.inset()) ? > >>> > >>I didn't dare to ask and I think I've seen this used in other parts of > >>the code. Don't ask me if this (it==0) is a good test though... > >> > > > >What happens if you put in a "proper" test as I proposed? > > > It seems to work fine. > > >It would at least be more legible. > > > > Yes, unless it this (it==0) has some special meaning... like start of > some environment or something. This DocIterator/ParIterator is really > complicated. This line of code originates from revision 9682, when Jean-Marc moved updateCounters from text2.C to buffer_funcs.C, and at the same time replaced pit_type arithmetic by pariterators. That's when "end" and its definition disappeared, and the changelog contains nothing on it... Jean-Marc, do you remember why you did this? - Martin
pgpAXIL2hkfwR.pgp
Description: PGP signature