Simplify code by using std::to_string

This commit is contained in:
Sude 2013-06-08 00:32:31 +03:00
parent d8272e30f8
commit f1a138e6bf

View File

@ -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);