summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-09-05 13:49:23 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2021-12-17 15:36:04 +0000
commit4d0c2213c1c2345d12ff877741293229005d9afd (patch)
tree0b19159a416871acc8870d6b5a0ad20bc6c686a1
parentConst only operations in flatmap (diff)
downloadicespider-4d0c2213c1c2345d12ff877741293229005d9afd.tar.bz2
icespider-4d0c2213c1c2345d12ff877741293229005d9afd.tar.xz
icespider-4d0c2213c1c2345d12ff877741293229005d9afd.zip
Use flatmap for qs and cookie maps
-rw-r--r--icespider/fcgi/cgiRequestBase.cpp2
-rw-r--r--icespider/fcgi/cgiRequestBase.h5
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<decltype(k)>(k), std::forward<decltype(v)>(v));
+ map.insert({std::forward<decltype(k)>(k), std::forward<decltype(v)>(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<std::string_view, std::string_view>;
using HdrMap = flatmap<std::string_view, std::string_view, AdHoc::case_less>;
+ using StrMap = flatmap<std::string, std::string>;
[[nodiscard]] const PathElements & getRequestPath() const override;
[[nodiscard]] PathElements & getRequestPath() override;
@@ -36,8 +37,8 @@ namespace IceSpider {
template<typename MapType> 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;
};