From e09158efee92c6a57f5228af35f1cf8e0eeb07d8 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 5 Oct 2021 16:58:49 +0200 Subject: [PATCH] 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 526cb33791..0f36dcab84 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -228,7 +228,7 @@ struct BufferView::Private /// CoordCache coord_cache_; /// - typedef map MathRows; + typedef unordered_map 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 d1c0fa3417..2780fc3213 100644 --- a/src/CoordCache.h +++ b/src/CoordCache.h @@ -16,7 +16,7 @@ #include "Dimension.h" -#include +#include namespace lyx { @@ -153,7 +153,7 @@ private: lyxbreaker(thing, hint, data_.size()); } - typedef std::map cache_type; + typedef std::unordered_map cache_type; cache_type data_; };