From 9f632c9355e217896c613326e5ec0289a88016aa Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 24 Jun 2021 14:11:51 +0100 Subject: [PATCH] [Minor] Another try to fix long compile time --- src/libserver/html/html_entities.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libserver/html/html_entities.cxx b/src/libserver/html/html_entities.cxx index 4ad68a0f8..573872f43 100644 --- a/src/libserver/html/html_entities.cxx +++ b/src/libserver/html/html_entities.cxx @@ -31,8 +31,8 @@ namespace rspamd::html { struct html_entity_def { - std::string name; - std::string replacement; + const char *name; + const char *replacement; unsigned code; bool allow_heuristic; }; @@ -2248,8 +2248,8 @@ decode_html_entitles_inplace(char *s, std::size_t len, bool norm_spaces) false); auto replace_entity = [&]() -> void { - auto l = entity_def->replacement.size(); - memcpy(t, entity_def->replacement.data(), l); + auto l = strlen(entity_def->replacement); + memcpy(t, entity_def->replacement, l); t += l; }; @@ -2384,10 +2384,10 @@ decode_html_entitles_inplace(char *s, std::size_t len, bool norm_spaces) const auto *entity_def = html_entities_defs.by_id(uc); if (entity_def) { - auto rep_len = entity_def->replacement.size(); + auto rep_len = strlen(entity_def->replacement); if (end - t >= rep_len) { - memcpy(t, entity_def->replacement.data(), + memcpy(t, entity_def->replacement, rep_len); t += rep_len; } -- 2.39.5