From f1a138e6bf7f76806292313b4c1ec1cda9240eda Mon Sep 17 00:00:00 2001 From: Sude Date: Sat, 8 Jun 2013 00:32:31 +0300 Subject: [PATCH] Simplify code by using std::to_string --- src/downloader.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/downloader.cpp b/src/downloader.cpp index 4743444..55afd21 100644 --- a/src/downloader.cpp +++ b/src/downloader.cpp @@ -830,10 +830,7 @@ int Downloader::repairFile(const std::string& url, const std::string& filepath, size_t chunk_begin = chunk_from.at(i); size_t chunk_end = chunk_to.at(i); size_t size=0, chunk_size = chunk_end - chunk_begin + 1; - std::stringstream ss; - ss << chunk_begin << "-" << chunk_end; - std::string range = ss.str(); - ss.str(std::string()); + std::string range = std::to_string(chunk_begin) + "-" + std::to_string(chunk_end); std::cout << "\033[0K\rChunk " << i << " (" << chunk_size << " bytes): "; fseek(outfile, chunk_begin, SEEK_SET);