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.
This commit is contained in:
Jean-Marc Lasgouttes 2021-10-05 16:58:49 +02:00
parent 3ad94ec6d9
commit e09158efee
2 changed files with 3 additions and 3 deletions

View File

@ -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.

View File

@ -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_;
};