From d0271a90b54a8580e288de02d5fd4934e31ae2a7 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 10 Nov 2014 21:23:26 +0900 Subject: [PATCH] nghttpd: Use util::utos instead of slow util::to_str --- src/HttpServer.cc | 2 +- src/util.h | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/HttpServer.cc b/src/HttpServer.cc index 6d343be1..ef4b9881 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -613,7 +613,7 @@ int Http2Handler::submit_file_response(const std::string& status, nghttp2_data_provider *data_prd) { std::string date_str = util::http_date(time(0)); - std::string content_length = util::to_str(file_length); + std::string content_length = util::utos(file_length); std::string last_modified_str; auto nva = std::vector{ http2::make_nv_ls(":status", status), diff --git a/src/util.h b/src/util.h index ee3c789f..48de2fb5 100644 --- a/src/util.h +++ b/src/util.h @@ -212,14 +212,6 @@ std::string http_date(time_t t); time_t parse_http_date(const std::string& s); -template -std::string to_str(T value) -{ - std::stringstream ss; - ss << value; - return ss.str(); -} - template bool startsWith (InputIterator1 first1,