From 9d8ace0b989d925aa1a950e69dbfca9323efb000 Mon Sep 17 00:00:00 2001 From: an-tao <20741618@qq.com> Date: Sun, 30 Dec 2018 23:45:21 +0800 Subject: [PATCH] Remove unused variables --- lib/src/HttpResponseImpl.cc | 1 + lib/src/HttpServer.cc | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/src/HttpResponseImpl.cc b/lib/src/HttpResponseImpl.cc index f1c3e2dd..7e13133e 100755 --- a/lib/src/HttpResponseImpl.cc +++ b/lib/src/HttpResponseImpl.cc @@ -378,6 +378,7 @@ std::shared_ptr HttpResponseImpl::renderToString() const } } auto httpString = std::make_shared(); + httpString->reserve(256); if (!_fullHeaderString) { makeHeaderString(httpString); diff --git a/lib/src/HttpServer.cc b/lib/src/HttpServer.cc index 699dbcc3..d75ffd24 100755 --- a/lib/src/HttpServer.cc +++ b/lib/src/HttpServer.cc @@ -126,7 +126,6 @@ void HttpServer::onMessage(const TcpConnectionPtr &conn, { context->setWebsockConnection(wsConn); } - MsgBuffer buffer; auto httpString = std::dynamic_pointer_cast(resp)->renderToString(); conn->send(httpString); }, @@ -252,7 +251,6 @@ void HttpServer::onRequest(const TcpConnectionPtr &conn, const HttpRequestPtr &r void HttpServer::sendResponse(const TcpConnectionPtr &conn, const HttpResponsePtr &response) { - MsgBuffer buf; auto httpString = std::dynamic_pointer_cast(response)->renderToString(); conn->send(httpString); auto &sendfileName = std::dynamic_pointer_cast(response)->sendfileName();