diff options
author | Oleg Morozenkov <omorozenkov@gmail.com> | 2018-06-17 22:03:01 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-17 22:03:01 +0300 |
commit | a854dd975f13e71338c80d85717be6fb6e8c185a (patch) | |
tree | 6db1b94ea9ca29b72f7788f7f8c62c2ae20222c2 /include/tgbot/net/HttpServer.h | |
parent | c8d40dccabaaa406faed6c0797a92bac811c9d0f (diff) | |
parent | b89c8f2fc73e25f1740c191faf0c7e8b9c18c9b9 (diff) |
Merge pull request #67 from JellyBrick/parser_refactor
Code optimization
Diffstat (limited to 'include/tgbot/net/HttpServer.h')
-rw-r--r-- | include/tgbot/net/HttpServer.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/tgbot/net/HttpServer.h b/include/tgbot/net/HttpServer.h index e760e29..34cd9c7 100644 --- a/include/tgbot/net/HttpServer.h +++ b/include/tgbot/net/HttpServer.h @@ -43,7 +43,7 @@ protected: class Connection; public: - typedef std::function<std::string (const std::string&, const std::map<std::string, std::string>)> ServerHandler; + typedef std::function<std::string (const std::string&, const std::unordered_map<std::string, std::string>)> ServerHandler; HttpServer(std::shared_ptr<boost::asio::basic_socket_acceptor<Protocol>> acceptor, const ServerHandler& handler) : _acceptor(acceptor), _handler(handler) { } @@ -80,7 +80,7 @@ protected: void start() { data.reserve(10240); socket->async_receive(data, [this]() { - std::map<std::string, std::string> headers; + std::unordered_map<std::string, std::string> headers; std::string body = HttpParser::getInstance().parseResponse(data, headers); socket->async_send(_handler(body, headers)); }); |