From a756403301ff8fb78df4dc1e131e4cd50cd976e1 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Mon, 28 May 2012 22:41:32 +0200 Subject: [PATCH] "Performance" fixes suggested by cppcheck While cppcheck did not turn out any suspicious error messages, using the "performance" flag highlighted several nitpicks in three categories * do not use it++ for iterators, ++it is better * do not use size() to test for emptyness, empty() is here * do not use "const T" as a function parameter, "const & T" is better I doubt that any of these is a real performance problem, but the code is cleaner anyway. --- src/Author.cpp | 4 ++-- src/Buffer.cpp | 2 +- src/BufferParams.cpp | 14 +++++++------- src/CutAndPaste.cpp | 4 ++-- src/LayoutModuleList.cpp | 4 ++-- src/LyX.cpp | 4 ++-- src/Paragraph.cpp | 2 +- src/Text.cpp | 2 +- src/TextClass.cpp | 2 +- src/TextMetrics.cpp | 3 ++- src/frontends/qt4/GuiDocument.cpp | 6 +++--- src/frontends/qt4/GuiGraphics.cpp | 2 +- src/frontends/qt4/LengthCombo.cpp | 2 +- src/frontends/qt4/LengthCombo.h | 2 +- src/frontends/qt4/Menus.cpp | 2 +- src/frontends/qt4/Validator.cpp | 6 +++--- src/frontends/qt4/Validator.h | 6 +++--- src/graphics/GraphicsLoader.cpp | 2 +- src/mathed/InsetMathArray.cpp | 2 +- src/mathed/InsetMathNest.cpp | 2 +- src/output_latex.cpp | 4 +--- src/output_xhtml.cpp | 2 +- src/tex2lyx/Preamble.cpp | 6 +++--- src/tex2lyx/tex2lyx.cpp | 6 +++--- src/tex2lyx/text.cpp | 14 +++++++------- 25 files changed, 52 insertions(+), 53 deletions(-) diff --git a/src/Author.cpp b/src/Author.cpp index f1d346ea75..12f7137a5f 100644 --- a/src/Author.cpp +++ b/src/Author.cpp @@ -53,7 +53,7 @@ ostream & operator<<(ostream & os, Author const & a) // FIXME UNICODE os << a.buffer_id_ << " \"" << to_utf8(a.name_) << "\" " << to_utf8(a.email_); - + return os; } @@ -85,7 +85,7 @@ int AuthorList::record(Author const & a) // If we record an author which equals the current // author, we copy the buffer_id, so that it will // keep the same id in the file. - if (authors_.size() > 0 && a == authors_[0]) + if (!authors_.empty() && a == authors_[0]) authors_[0].setBufferId(a.bufferId()); Authors::const_iterator it(authors_.begin()); diff --git a/src/Buffer.cpp b/src/Buffer.cpp index d4dde78ac0..8fb72aecb1 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -2879,7 +2879,7 @@ MacroData const * Buffer::Impl::getBufferMacro(docstring const & name, // try previous macro if there is one if (it == nameIt->second.begin()) break; - it--; + --it; } } } diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 0a7e5947f6..b9854e5867 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -942,7 +942,7 @@ void BufferParams::writeFile(ostream & os) const os << "\\begin_removed_modules" << '\n'; list::const_iterator it = removed_modules_.begin(); list::const_iterator en = removed_modules_.end(); - for (; it != en; it++) + for (; it != en; ++it) os << *it << '\n'; os << "\\end_removed_modules" << '\n'; } @@ -952,7 +952,7 @@ void BufferParams::writeFile(ostream & os) const os << "\\begin_modules" << '\n'; LayoutModuleList::const_iterator it = layout_modules_.begin(); LayoutModuleList::const_iterator en = layout_modules_.end(); - for (; it != en; it++) + for (; it != en; ++it) os << *it << '\n'; os << "\\end_modules" << '\n'; } @@ -962,7 +962,7 @@ void BufferParams::writeFile(ostream & os) const os << "\\begin_includeonly" << '\n'; list::const_iterator it = included_children_.begin(); list::const_iterator en = included_children_.end(); - for (; it != en; it++) + for (; it != en; ++it) os << *it << '\n'; os << "\\end_includeonly" << '\n'; } @@ -2026,11 +2026,11 @@ void BufferParams::makeDocumentClass() it = layout_modules_.begin(); en = layout_modules_.end(); - for (; it != en; it++) + for (; it != en; ++it) mods.push_back(*it); it = cite_engine_.begin(); en = cite_engine_.end(); - for (; it != en; it++) + for (; it != en; ++it) mods.push_back(*it); doc_class_ = &(DocumentClassBundle::get().makeDocumentClass(*baseClass(), mods)); @@ -2056,7 +2056,7 @@ bool BufferParams::addLayoutModule(string const & modName) { LayoutModuleList::const_iterator it = layout_modules_.begin(); LayoutModuleList::const_iterator end = layout_modules_.end(); - for (; it != end; it++) + for (; it != end; ++it) if (*it == modName) return false; layout_modules_.push_back(modName); @@ -2391,7 +2391,7 @@ void BufferParams::readRemovedModules(Lexer & lex) // start of the read. list::const_iterator rit = removed_modules_.begin(); list::const_iterator const ren = removed_modules_.end(); - for (; rit != ren; rit++) { + for (; rit != ren; ++rit) { LayoutModuleList::iterator const mit = layout_modules_.begin(); LayoutModuleList::iterator const men = layout_modules_.end(); LayoutModuleList::iterator found = find(mit, men, *rit); diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp index f60579bcf2..757e318b6e 100644 --- a/src/CutAndPaste.cpp +++ b/src/CutAndPaste.cpp @@ -528,7 +528,7 @@ void copySelectionHelper(Buffer const & buf, Text const & text, ParagraphList::iterator it = copy_pars.begin(); ParagraphList::iterator it_end = copy_pars.end(); - for (; it != it_end; it++) { + for (; it != it_end; ++it) { // Since we have a copy of the paragraphs, the insets // do not have a proper buffer reference. It makes // sense to add them temporarily, because the @@ -553,7 +553,7 @@ void copySelectionHelper(Buffer const & buf, Text const & text, // do some final cleanup now, to make sure that the paragraphs // are not linked to something else. it = copy_pars.begin(); - for (; it != it_end; it++) { + for (; it != it_end; ++it) { it->setBuffer(*static_cast(0)); it->setInsetOwner(0); } diff --git a/src/LayoutModuleList.cpp b/src/LayoutModuleList.cpp index 83c51fb967..a6507212a8 100644 --- a/src/LayoutModuleList.cpp +++ b/src/LayoutModuleList.cpp @@ -59,7 +59,7 @@ bool LayoutModuleList::moduleCanBeAdded(string const & modName, // Is the module already present? const_iterator it = begin(); const_iterator const en = end(); - for (; it != en; it++) + for (; it != en; ++it) if (*it == modName) return false; @@ -131,7 +131,7 @@ void LayoutModuleList::addDefaultModules(LayoutFile const * const lay, iterator insertpos = begin(); int numinserts = 0; - for (; mit != men; mit++) { + for (; mit != men; ++mit) { string const & modName = *mit; // make sure the user hasn't removed it if (find(removedModules.begin(), removedModules.end(), modName) != diff --git a/src/LyX.cpp b/src/LyX.cpp index 6b46066e08..d872b81d19 100644 --- a/src/LyX.cpp +++ b/src/LyX.cpp @@ -340,7 +340,7 @@ int LyX::exec(int & argc, char * argv[]) vector::const_iterator bcit = pimpl_->batch_commands.begin(); vector::const_iterator bcend = pimpl_->batch_commands.end(); DispatchResult dr; - for (; bcit != bcend; bcit++) { + for (; bcit != bcend; ++bcit) { LYXERR(Debug::ACTION, "Buffer::dispatch: cmd: " << *bcit); buf->dispatch(*bcit, dr); final_success |= !dr.error(); @@ -587,7 +587,7 @@ void LyX::execCommands() vector::const_iterator bcit = pimpl_->batch_commands.begin(); vector::const_iterator bcend = pimpl_->batch_commands.end(); - for (; bcit != bcend; bcit++) { + for (; bcit != bcend; ++bcit) { LYXERR(Debug::INIT, "About to handle -x '" << *bcit << '\''); lyx::dispatch(lyxaction.lookupFunc(*bcit)); } diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index afcf5ac57a..81d3acd1be 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -134,7 +134,7 @@ public: current_change_number_ = 0; } - void setRange(FontSpan const fp, SpellChecker::Result state) + void setRange(FontSpan const & fp, SpellChecker::Result state) { Ranges result; RangesIterator et = ranges_.end(); diff --git a/src/Text.cpp b/src/Text.cpp index 01d1ab0efe..aa23b71261 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -1696,7 +1696,7 @@ bool Text::dissolveInset(Cursor & cur) // change it to the buffer language. ParagraphList::iterator it = plist.begin(); ParagraphList::iterator it_end = plist.end(); - for (; it != it_end; it++) + for (; it != it_end; ++it) it->changeLanguage(b.params(), latex_language, b.language()); pasteParagraphList(cur, plist, b.params().documentClassPtr(), diff --git a/src/TextClass.cpp b/src/TextClass.cpp index ee4181c7de..65d5ef84d4 100644 --- a/src/TextClass.cpp +++ b/src/TextClass.cpp @@ -1465,7 +1465,7 @@ DocumentClass & DocumentClassBundle::makeDocumentClass( DocumentClass & doc_class = newClass(baseClass); LayoutModuleList::const_iterator it = modlist.begin(); LayoutModuleList::const_iterator en = modlist.end(); - for (; it != en; it++) { + for (; it != en; ++it) { string const modName = *it; LyXModule * lm = theModuleList[modName]; if (!lm) { diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 0756befbef..f291e397f0 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -1389,7 +1389,8 @@ pit_type TextMetrics::getPitNearY(int y) int yy = -1; ParMetricsCache::const_iterator it = par_metrics_.begin(); ParMetricsCache::const_iterator et = par_metrics_.end(); - ParMetricsCache::const_iterator last = et; last--; + ParMetricsCache::const_iterator last = et; + --last; ParagraphMetrics const & pm = it->second; diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index 0708f01db2..ba55eb2fda 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -2132,7 +2132,7 @@ namespace { docstring formatStrVec(vector const & v, docstring const & s) { //this mess formats the list as "v[0], v[1], ..., [s] v[n]" - if (v.size() == 0) + if (v.empty()) return docstring(); if (v.size() == 1) return translateIfPossible(from_utf8(v[0])); @@ -2188,11 +2188,11 @@ void GuiDocument::modulesToParams(BufferParams & bp) list::const_iterator ren = reqmods.end(); // check each of the default modules - for (; rit != ren; rit++) { + for (; rit != ren; ++rit) { list::const_iterator mit = bp.getModules().begin(); list::const_iterator men = bp.getModules().end(); bool found = false; - for (; mit != men; mit++) { + for (; mit != men; ++mit) { if (*rit == *mit) { found = true; break; diff --git a/src/frontends/qt4/GuiGraphics.cpp b/src/frontends/qt4/GuiGraphics.cpp index 99cf2d85e2..66bf83661f 100644 --- a/src/frontends/qt4/GuiGraphics.cpp +++ b/src/frontends/qt4/GuiGraphics.cpp @@ -575,7 +575,7 @@ void GuiGraphics::paramsToDialog(InsetGraphicsParams const & igp) set::const_iterator end = grp.end(); groupCO->blockSignals(true); groupCO->clear(); - for (; it != end; it++) + for (; it != end; ++it) groupCO->addItem(toqstr(*it), toqstr(*it)); groupCO->insertItem(0, qt_("None"), QString()); if (igp.groupId.empty()) diff --git a/src/frontends/qt4/LengthCombo.cpp b/src/frontends/qt4/LengthCombo.cpp index 8e57af1ca6..727eebf16a 100644 --- a/src/frontends/qt4/LengthCombo.cpp +++ b/src/frontends/qt4/LengthCombo.cpp @@ -58,7 +58,7 @@ void LengthCombo::setCurrentItem(lyx::Length::UNIT unit) } -void LengthCombo::setCurrentItem(QString const item) +void LengthCombo::setCurrentItem(QString const & item) { int num = QComboBox::count(); for (int i = 0; i < num; i++) { diff --git a/src/frontends/qt4/LengthCombo.h b/src/frontends/qt4/LengthCombo.h index f47a178ba8..7c7557f9f3 100644 --- a/src/frontends/qt4/LengthCombo.h +++ b/src/frontends/qt4/LengthCombo.h @@ -31,7 +31,7 @@ public: /// set the current item from unit virtual void setCurrentItem(lyx::Length::UNIT unit); /// set the current item from length string - virtual void setCurrentItem(QString const item); + virtual void setCurrentItem(QString const & item); /// set the current item from int virtual void setCurrentItem(int item); /// get the current item diff --git a/src/frontends/qt4/Menus.cpp b/src/frontends/qt4/Menus.cpp index 9e815271de..40a4f575e3 100644 --- a/src/frontends/qt4/Menus.cpp +++ b/src/frontends/qt4/Menus.cpp @@ -747,7 +747,7 @@ void MenuDefinition::expandGraphicsGroups(BufferView const * bv) set::const_iterator end = grp.end(); add(MenuItem(MenuItem::Command, qt_("No Group"), FuncRequest(LFUN_SET_GRAPHICS_GROUP))); - for (; it != end; it++) { + for (; it != end; ++it) { addWithStatusCheck(MenuItem(MenuItem::Command, toqstr(*it) + '|', FuncRequest(LFUN_SET_GRAPHICS_GROUP, *it))); } diff --git a/src/frontends/qt4/Validator.cpp b/src/frontends/qt4/Validator.cpp index 7f5d5d45e2..13f813e9f3 100644 --- a/src/frontends/qt4/Validator.cpp +++ b/src/frontends/qt4/Validator.cpp @@ -97,7 +97,7 @@ LengthValidator * unsignedGlueLengthValidator(QLineEdit * ed) } -LengthAutoValidator::LengthAutoValidator(QWidget * parent, QString const autotext) +LengthAutoValidator::LengthAutoValidator(QWidget * parent, QString const & autotext) : LengthValidator(parent), autotext_(autotext) {} @@ -111,7 +111,7 @@ QValidator::State LengthAutoValidator::validate(QString & qtext, int & dummy) co } -LengthAutoValidator * unsignedLengthAutoValidator(QLineEdit * ed, QString const autotext) +LengthAutoValidator * unsignedLengthAutoValidator(QLineEdit * ed, QString const & autotext) { LengthAutoValidator * v = new LengthAutoValidator(ed, autotext); v->setBottom(Length()); @@ -119,7 +119,7 @@ LengthAutoValidator * unsignedLengthAutoValidator(QLineEdit * ed, QString const } -DoubleAutoValidator::DoubleAutoValidator(QWidget * parent, QString const autotext) +DoubleAutoValidator::DoubleAutoValidator(QWidget * parent, QString const & autotext) : QDoubleValidator(parent), autotext_(autotext) {} diff --git a/src/frontends/qt4/Validator.h b/src/frontends/qt4/Validator.h index e824659323..0c4dbde632 100644 --- a/src/frontends/qt4/Validator.h +++ b/src/frontends/qt4/Validator.h @@ -90,7 +90,7 @@ class LengthAutoValidator : public LengthValidator Q_OBJECT public: /// Define a validator for widget @c parent. - LengthAutoValidator(QWidget * parent, QString const autotext); + LengthAutoValidator(QWidget * parent, QString const & autotext); /** @returns QValidator::Acceptable if @c data is a GlueLength * or is "auto". If not, returns QValidator::Intermediate. @@ -102,7 +102,7 @@ private: }; /// @returns a new @c LengthAutoValidator that does not accept negative lengths. -LengthAutoValidator * unsignedLengthAutoValidator(QLineEdit *, QString const autotext); +LengthAutoValidator * unsignedLengthAutoValidator(QLineEdit *, QString const & autotext); /** @@ -114,7 +114,7 @@ class DoubleAutoValidator : public QDoubleValidator { Q_OBJECT public: - DoubleAutoValidator(QWidget * parent, QString const autotext); + DoubleAutoValidator(QWidget * parent, QString const & autotext); DoubleAutoValidator(double bottom, double top, int decimals, QObject * parent); QValidator::State validate(QString & input, int & pos) const; diff --git a/src/graphics/GraphicsLoader.cpp b/src/graphics/GraphicsLoader.cpp index 82c5b1afda..36f2839446 100644 --- a/src/graphics/GraphicsLoader.cpp +++ b/src/graphics/GraphicsLoader.cpp @@ -96,7 +96,7 @@ void LoaderQueue::loadNext() if (ptr->status() == WaitingToLoad) ptr->startLoading(); } - if (cache_queue_.size()) { + if (!cache_queue_.empty()) { startLoader(); } else { stopLoader(); diff --git a/src/mathed/InsetMathArray.cpp b/src/mathed/InsetMathArray.cpp index fd7ceebe31..821f4605e8 100644 --- a/src/mathed/InsetMathArray.cpp +++ b/src/mathed/InsetMathArray.cpp @@ -51,7 +51,7 @@ InsetMathArray::InsetMathArray(Buffer * buf, docstring const & name, istringstream ls(line); typedef istream_iterator iter; vector v = vector(iter(ls), iter()); - if (v.size()) + if (!v.empty()) dat.push_back(v); } diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index 5d35d779e3..0e4352546c 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -2064,7 +2064,7 @@ MathCompletionList::MathCompletionList(Cursor const & cur) } sort(locals.begin(), locals.end()); - if (globals.size() > 0) + if (!globals.empty()) return; // fill in global macros diff --git a/src/output_latex.cpp b/src/output_latex.cpp index b29e7fde60..ad541fea6e 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -239,7 +239,6 @@ void TeXEnvironment(Buffer const & buf, Text const & text, // This is for debugging purpose at the end. pit_type const par_begin = pit; for (; pit < runparams.par_end; ++pit) { - ParagraphList::const_iterator par = paragraphs.constIterator(pit); // check first if this is an higher depth paragraph. @@ -276,7 +275,6 @@ void TeXEnvironment(Buffer const & buf, Text const & text, // be two for Standard paragraphs that are depth-increment'ed to be // output correctly. However, tables can also be paragraphs so // don't adjust them. - // // FIXME (Lgb): Will it ever harm to have one '\n' too // many? i.e. that we sometimes will have @@ -333,7 +331,7 @@ void latexArgInsets(Paragraph const & par, otexstream & os, } } - if (!reqargs && ilist.size() == 0) + if (!reqargs && ilist.empty()) return; bool const have_optional_args = ilist.size() > reqargs; diff --git a/src/output_xhtml.cpp b/src/output_xhtml.cpp index d98aa0e993..d039544610 100644 --- a/src/output_xhtml.cpp +++ b/src/output_xhtml.cpp @@ -727,7 +727,7 @@ ParagraphList::const_iterator makeParagraphs(Buffer const & buf, // (ii) We didn't open it and html_in_par is true, // but we are in the first par, and there is a next par. ParagraphList::const_iterator nextpar = par; - nextpar++; + ++nextpar; bool const needclose = (opened && (!runparams.html_in_par || nextpar != pend)) || (!opened && runparams.html_in_par && par == pbegin && nextpar != pend); diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp index 6b4b40467b..131f1d8a47 100644 --- a/src/tex2lyx/Preamble.cpp +++ b/src/tex2lyx/Preamble.cpp @@ -340,7 +340,7 @@ Author const & Preamble::getAuthor(std::string const & name) const { Author author(from_utf8(name), empty_docstring()); for (AuthorList::Authors::const_iterator it = authors_.begin(); - it != authors_.end(); it++) + it != authors_.end(); ++it) if (*it == author) return *it; static Author const dummy; @@ -887,7 +887,7 @@ bool Preamble::writeLyXHeader(ostream & os, bool subdoc) os << "\\begin_modules\n"; vector::const_iterator const end = used_modules.end(); vector::const_iterator it = used_modules.begin(); - for (; it != end; it++) + for (; it != end; ++it) os << *it << '\n'; os << "\\end_modules\n"; } @@ -936,7 +936,7 @@ bool Preamble::writeLyXHeader(ostream & os, bool subdoc) os << "\\papersize " << h_papersize << "\n" << "\\use_geometry " << h_use_geometry << '\n'; for (map::const_iterator it = h_use_packages.begin(); - it != h_use_packages.end(); it++) + it != h_use_packages.end(); ++it) os << "\\use_package " << it->first << ' ' << it->second << '\n'; os << "\\cite_engine " << h_cite_engine << '\n' << "\\cite_engine_type " << h_cite_engine_type << '\n' diff --git a/src/tex2lyx/tex2lyx.cpp b/src/tex2lyx/tex2lyx.cpp index 9a4ca4f410..94e099a66c 100644 --- a/src/tex2lyx/tex2lyx.cpp +++ b/src/tex2lyx/tex2lyx.cpp @@ -262,7 +262,7 @@ bool checkModule(string const & name, bool command) DocumentClassBundle & bundle = DocumentClassBundle::get(); LyXModuleList::const_iterator const end = theModuleList.end(); LyXModuleList::const_iterator it = theModuleList.begin(); - for (; it != end; it++) { + for (; it != end; ++it) { string const module = it->getID(); LayoutModuleList m; // FIXME this excludes all modules that depend on another one @@ -282,7 +282,7 @@ bool checkModule(string const & name, bool command) // needed since it is not unlikely that two different modules define a // command with the same name. ModuleMap::iterator const end = modules.end(); - for (ModuleMap::iterator it = modules.begin(); it != end; it++) { + for (ModuleMap::iterator it = modules.begin(); it != end; ++it) { string const module = it->first; if (!used_modules.moduleCanBeAdded(module, &baseClass)) continue; @@ -682,7 +682,7 @@ bool tex2lyx(idocstream & is, ostream & os, string encoding) if (!used_modules.empty()) { LayoutModuleList::const_iterator const end = used_modules.end(); LayoutModuleList::const_iterator it = used_modules.begin(); - for (; it != end; it++) + for (; it != end; ++it) preamble.addModule(*it); } if (!preamble.writeLyXHeader(os, !active_environments.empty())) { diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index 3f65d43642..24694d3da2 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -461,7 +461,7 @@ docstring convert_unicodesymbols(docstring s) set req; docstring parsed = encodings.fromLaTeXCommand(s, Encodings::TEXT_CMD, termination, rem, &req); - for (set::const_iterator it = req.begin(); it != req.end(); it++) + for (set::const_iterator it = req.begin(); it != req.end(); ++it) preamble.registerAutomaticallyLoadedPackage(*it); os << parsed; s = rem; @@ -1556,7 +1556,7 @@ void parse_environment(Parser & p, ostream & os, bool outer, if (!preamble.titleLayoutFound()) preamble.titleLayoutFound(newlayout->intitle); set const & req = newlayout->requires(); - for (set::const_iterator it = req.begin(); it != req.end(); it++) + for (set::const_iterator it = req.begin(); it != req.end(); ++it) preamble.registerAutomaticallyLoadedPackage(*it); } @@ -2487,7 +2487,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, preamble.titleLayoutFound(newlayout->intitle); set const & req = newlayout->requires(); for (set::const_iterator it = req.begin(); - it != req.end(); it++) + it != req.end(); ++it) preamble.registerAutomaticallyLoadedPackage(*it); } else handle_ert(os, @@ -2508,7 +2508,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, if (!preamble.titleLayoutFound()) preamble.titleLayoutFound(newlayout->intitle); set const & req = newlayout->requires(); - for (set::const_iterator it = req.begin(); it != req.end(); it++) + for (set::const_iterator it = req.begin(); it != req.end(); ++it) preamble.registerAutomaticallyLoadedPackage(*it); } @@ -2521,7 +2521,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, if (!preamble.titleLayoutFound()) preamble.titleLayoutFound(newlayout->intitle); set const & req = newlayout->requires(); - for (set::const_iterator it = req.begin(); it != req.end(); it++) + for (set::const_iterator it = req.begin(); it != req.end(); ++it) preamble.registerAutomaticallyLoadedPackage(*it); } @@ -3521,7 +3521,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, << ", result is " << to_utf8(s) << "+" << to_utf8(rem) << endl; os << to_utf8(s); - for (set::const_iterator it = req.begin(); it != req.end(); it++) + for (set::const_iterator it = req.begin(); it != req.end(); ++it) preamble.registerAutomaticallyLoadedPackage(*it); } else // we did not find a non-ert version @@ -4128,7 +4128,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, os << to_utf8(s); if (termination) skip_spaces_braces(p); - for (set::const_iterator it = req.begin(); it != req.end(); it++) + for (set::const_iterator it = req.begin(); it != req.end(); ++it) preamble.registerAutomaticallyLoadedPackage(*it); } //cerr << "#: " << t << " mode: " << mode << endl; -- 2.39.5