From: Vsevolod Stakhov Date: Wed, 23 Jun 2021 18:53:37 +0000 (+0100) Subject: [Minor] Another try to reduce compile time using broken toolset X-Git-Tag: 3.0~244 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e1a5d57c6e397f2125ce1aaad7292e11288b7eef;p=rspamd.git [Minor] Another try to reduce compile time using broken toolset --- 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;