From e1a5d57c6e397f2125ce1aaad7292e11288b7eef Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 23 Jun 2021 19:53:37 +0100 Subject: [PATCH] [Minor] Another try to reduce compile time using broken toolset --- src/libserver/html/html_entities.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libserver/html/html_entities.cxx b/src/libserver/html/html_entities.cxx index d124ace1e..4ad68a0f8 100644 --- a/src/libserver/html/html_entities.cxx +++ b/src/libserver/html/html_entities.cxx @@ -40,7 +40,7 @@ struct html_entity_def { #define ENTITY_DEF(name, code, replacement) html_entity_def{(name), (replacement), (code), false} #define ENTITY_DEF_HEUR(name, code, replacement) html_entity_def{(name), (replacement), (code), true} -static const auto html_entities_array = std::vector{ +static const html_entity_def html_entities_array[] = { ENTITY_DEF_HEUR("szlig", 223, "\xc3\x9f"), ENTITY_DEF("prime", 8242, "\xe2\x80\xb2"), ENTITY_DEF("lnsim", 8934, "\xe2\x8b\xa6"), @@ -2173,8 +2173,9 @@ class html_entities_storage { robin_hood::unordered_flat_map entity_by_id; public: html_entities_storage() { - entity_by_name.reserve(html_entities_array.size()); - entity_by_id.reserve(html_entities_array.size()); + auto nelts = G_N_ELEMENTS(html_entities_array); + entity_by_name.reserve(nelts); + entity_by_id.reserve(nelts); for (const auto &e : html_entities_array) { entity_by_name[e.name] = e; -- 2.39.5