commit e09158efee92c6a57f5228af35f1cf8e0eeb07d8
Author: Jean-Marc Lasgouttes <[email protected]>
Date: Tue Oct 5 16:58:49 2021 +0200
Use unordered maps to store inset and math rows geometry.
Simply using unordered_map instead of map makes a big difference for
documents with lots of math insets in one text inset.
Related to bug #12297.
---
src/BufferView.cpp | 2 +-
src/CoordCache.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index 526cb33..0f36dca 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -228,7 +228,7 @@ struct BufferView::Private
///
CoordCache coord_cache_;
///
- typedef map<MathData const *, MathRow> MathRows;
+ typedef unordered_map<MathData const *, MathRow> MathRows;
MathRows math_rows_;
/// this is used to handle XSelection events in the right manner.
diff --git a/src/CoordCache.h b/src/CoordCache.h
index d1c0fa3..2780fc3 100644
--- a/src/CoordCache.h
+++ b/src/CoordCache.h
@@ -16,7 +16,7 @@
#include "Dimension.h"
-#include <map>
+#include <unordered_map>
namespace lyx {
@@ -153,7 +153,7 @@ private:
lyxbreaker(thing, hint, data_.size());
}
- typedef std::map<T const *, Geometry> cache_type;
+ typedef std::unordered_map<T const *, Geometry> cache_type;
cache_type data_;
};
--
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs