> > +int countChars(DocIterator const & from, DocIterator const & to, bool > > with_blanks) > > +{ > > + int chars = 0; > > + int blanks = 0; > > + for (DocIterator dit = from ; dit != to ; dit.forwardPos()) { > > + if (dit.inTexted() > > + && dit.pos() != dit.lastpos() > > + && !dit.paragraph().isDeleted(dit.pos())) { > > + if (dit.paragraph().isInset(dit.pos())) { > > + if > > (dit.paragraph().getInset(dit.pos())->isLetter()) > > + ++chars; > > + else if > > (dit.paragraph().getInset(dit.pos())->isSpace() && with_blanks) > > + ++blanks; > > Can't you use temporary variables for dit.paragraph() and > dit.paragraph().getInset(dit.pos())?
i changed it. btw you think this optimization in such kind of rarely used code is recognizable? pavel