From: Jean-Marc Lasgouttes Date: Tue, 8 Dec 2009 22:41:10 +0000 (+0000) Subject: Speedup updateMacroInstances. This has some effect on document loading time: X-Git-Tag: 2.0.0~4872 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=52061b8313f54a58e5b131210cf01a293c9c49f8;p=features.git Speedup updateMacroInstances. This has some effect on document loading time: it was a significant part of this time git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32435 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 57ce529c73..d4a519004f 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -2657,14 +2657,11 @@ void Buffer::updateMacroInstances() const LYXERR(Debug::MACROS, "updateMacroInstances for " << d->filename.onlyFileName()); DocIterator it = doc_iterator_begin(this); - DocIterator end = doc_iterator_end(this); - for (; it != end; it.forwardPos()) { - // look for MathData cells in InsetMathNest insets - Inset * inset = it.nextInset(); - if (!inset) - continue; - - InsetMath * minset = inset->asInsetMath(); + it.forwardInset(); + DocIterator const end = doc_iterator_end(this); + for (; it != end; it.forwardInset()) { + // look for MathData cells in InsetMathNest insets + InsetMath * minset = it.nextInset()->asInsetMath(); if (!minset) continue;