From 4d0c2213c1c2345d12ff877741293229005d9afd Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 5 Sep 2021 13:49:23 +0100 Subject: Use flatmap for qs and cookie maps --- icespider/fcgi/cgiRequestBase.cpp | 2 +- icespider/fcgi/cgiRequestBase.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/icespider/fcgi/cgiRequestBase.cpp b/icespider/fcgi/cgiRequestBase.cpp index c43ea57..fbb195d 100644 --- a/icespider/fcgi/cgiRequestBase.cpp +++ b/icespider/fcgi/cgiRequestBase.cpp @@ -50,7 +50,7 @@ namespace IceSpider { XWwwFormUrlEncoded::iterateVars( qs->second, [&map](auto && k, auto && v) { - map.emplace(std::forward(k), std::forward(v)); + map.insert({std::forward(k), std::forward(v)}); }, sp); } diff --git a/icespider/fcgi/cgiRequestBase.h b/icespider/fcgi/cgiRequestBase.h index 710b0f0..774f06d 100644 --- a/icespider/fcgi/cgiRequestBase.h +++ b/icespider/fcgi/cgiRequestBase.h @@ -17,6 +17,7 @@ namespace IceSpider { public: using VarMap = flatmap; using HdrMap = flatmap; + using StrMap = flatmap; [[nodiscard]] const PathElements & getRequestPath() const override; [[nodiscard]] PathElements & getRequestPath() override; @@ -36,8 +37,8 @@ namespace IceSpider { template static OptionalString optionalLookup(const std::string_view & key, const MapType &); VarMap envmap {40}; - StringMap qsmap; - StringMap cookiemap; + StrMap qsmap; + StrMap cookiemap; HdrMap hdrmap {15}; PathElements pathElements; }; -- cgit v1.2.3