From c3dcb443fc8820b5e755b76df8a958e6f95be42c Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 23 Jun 2021 18:10:06 +0100 Subject: [PATCH] [Minor] Reduce template overload by switching to vector --- src/libserver/html/html_entities.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libserver/html/html_entities.cxx b/src/libserver/html/html_entities.cxx index b0e682807..d124ace1e 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 = rspamd::array_of( +static const auto html_entities_array = std::vector{ ENTITY_DEF_HEUR("szlig", 223, "\xc3\x9f"), ENTITY_DEF("prime", 8242, "\xe2\x80\xb2"), ENTITY_DEF("lnsim", 8934, "\xe2\x8b\xa6"), @@ -1735,7 +1735,7 @@ static const auto html_entities_array = rspamd::array_of( ENTITY_DEF("die", 168, "\xc2\xa8"), ENTITY_DEF("ngt", 8815, "\xe2\x89\xaf"), ENTITY_DEF("vcy", 1074, "\xd0\xb2"), - ENTITY_DEF("fjlig", (unsigned)-1, "\x66\x6a"), + ENTITY_DEF("fjlig", (unsigned) -1, "\x66\x6a"), ENTITY_DEF("submult", 10945, "\xe2\xab\x81"), ENTITY_DEF("ubrcy", 1118, "\xd1\x9e"), ENTITY_DEF("ovbar", 9021, "\xe2\x8c\xbd"), @@ -2165,7 +2165,7 @@ static const auto html_entities_array = rspamd::array_of( ENTITY_DEF("imped", 437, "\xc6\xb5"), ENTITY_DEF("barwedge", 8965, "\xe2\x8c\x85"), ENTITY_DEF("harrcir", 10568, "\xe2\xa5\x88") -); +}; class html_entities_storage { robin_hood::unordered_flat_map entity_by_name; -- 2.39.5