lasgout...@lyx.org wrote:
Author: lasgouttes
Date: Tue Dec 8 23:41:10 2009
New Revision: 32435
URL: http://www.lyx.org/trac/changeset/32435
Log:
Speedup updateMacroInstances. This has some effect on document loading time:
it was a significant part of this time
This commit is obviously correct but Vincent reported something strange
with forwardInset(), in that this will jump over portion of the document
instead of merely poping out of the current inset. Or maybe it is just
that the method name is misleading? In this case, I would rename it to
nextInset().
Abdel.
Modified:
lyx-devel/trunk/src/Buffer.cpp
Modified: lyx-devel/trunk/src/Buffer.cpp
==============================================================================
--- lyx-devel/trunk/src/Buffer.cpp Tue Dec 8 19:58:14 2009 (r32434)
+++ lyx-devel/trunk/src/Buffer.cpp Tue Dec 8 23:41:10 2009 (r32435)
@@ -2657,14 +2657,11 @@
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;