summaryrefslogtreecommitdiff
path: root/include/tgbot/net/HttpParser.h
diff options
context:
space:
mode:
authorJellyBrick <shlee1503@naver.com>2018-06-08 15:26:25 +0900
committerJellyBrick <shlee1503@naver.com>2018-06-08 15:26:25 +0900
commit237684cfd042917a26274872c4ffe1e3cdd5c3a8 (patch)
treeff57c7fe069ddf35c8ba1f6c4500c18cc81ab133 /include/tgbot/net/HttpParser.h
parentc8d40dccabaaa406faed6c0797a92bac811c9d0f (diff)
Performance optimization
Diffstat (limited to 'include/tgbot/net/HttpParser.h')
-rw-r--r--include/tgbot/net/HttpParser.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/tgbot/net/HttpParser.h b/include/tgbot/net/HttpParser.h
index ec4c077..d40619a 100644
--- a/include/tgbot/net/HttpParser.h
+++ b/include/tgbot/net/HttpParser.h
@@ -24,7 +24,7 @@
#define TGBOT_HTTPPARSER_H
#include <string>
-#include <map>
+#include <unordered_map>
#include <vector>
#include "tgbot/net/Url.h"
@@ -43,7 +43,7 @@ public:
std::string generateWwwFormUrlencoded(const std::vector<HttpReqArg>& args);
std::string generateResponse(const std::string& data, const std::string& mimeType = "text/plain", short unsigned statusCode = 200, const std::string& statusStr = "OK", bool isKeepAlive = false);
- inline std::string parseRequest(const std::string& data, std::map<std::string, std::string>& headers) {
+ inline std::string parseRequest(const std::string& data, std::unordered_map<std::string, std::string>& headers) {
return parseHttp(true, data, headers);
}
@@ -51,7 +51,7 @@ public:
return parseHttp(true, data);
}
- inline std::string parseResponse(const std::string& data, std::map<std::string, std::string>& headers) {
+ inline std::string parseResponse(const std::string& data, std::unordered_map<std::string, std::string>& headers) {
return parseHttp(false, data, headers);
}
@@ -60,7 +60,7 @@ public:
}
private:
- std::string parseHttp(bool isRequest, const std::string& data, std::map<std::string, std::string>& headers);
+ std::string parseHttp(bool isRequest, const std::string& data, std::unordered_map<std::string, std::string>& headers);
std::string parseHttp(bool isRequest, const std::string& data);
};