Skip to content

Commit

Permalink
Remove custom to_string methods
Browse files Browse the repository at this point in the history
  • Loading branch information
mmd-osm committed Aug 16, 2023
1 parent 706f6ca commit de4fc45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 27 deletions.
15 changes: 2 additions & 13 deletions src/template_db/lz4_wrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,9 @@
#include <stdexcept>


namespace
{
template < typename T >
std::string to_string(T t)
{
std::ostringstream out;
out<<std::setprecision(14)<<t;
return out.str();
}
}


LZ4_Deflate::Error::Error(int error_code_)
: std::runtime_error("LZ4_Deflate: " + to_string(error_code_)), error_code(error_code_)
: std::runtime_error("LZ4_Deflate: " + std::to_string(error_code_)), error_code(error_code_)
{}


Expand Down Expand Up @@ -75,7 +64,7 @@ int LZ4_Deflate::compress(const void* in, int in_size, void* out, int out_buffer


LZ4_Inflate::Error::Error(int error_code_)
: std::runtime_error("LZ4_Inflate: " + to_string(error_code_)), error_code(error_code_)
: std::runtime_error("LZ4_Inflate: " + std::to_string(error_code_)), error_code(error_code_)
{}


Expand Down
16 changes: 2 additions & 14 deletions src/template_db/zlib_wrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,8 @@
#include <vector>


namespace
{
template < typename T >
std::string to_string(T t)
{
std::ostringstream out;
out<<std::setprecision(14)<<t;
return out.str();
}
}


Zlib_Deflate::Error::Error(int error_code_)
: std::runtime_error("Zlib_Deflate: " + to_string(error_code_)), error_code(error_code_)
: std::runtime_error("Zlib_Deflate: " + std::to_string(error_code_)), error_code(error_code_)
{}


Expand Down Expand Up @@ -77,7 +65,7 @@ int Zlib_Deflate::compress(const void* in, int in_size, void* out, int out_buffe


Zlib_Inflate::Error::Error(int error_code_)
: std::runtime_error("Zlib_Inflate: " + to_string(error_code_)), error_code(error_code_)
: std::runtime_error("Zlib_Inflate: " + std::to_string(error_code_)), error_code(error_code_)
{}


Expand Down

0 comments on commit de4fc45

Please sign in to comment.