Skip to content

Commit

Permalink
use faster boost::lexical_cast since we have to use it anyway
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Voigt authored and Alexander Voigt committed Nov 5, 2015
1 parent 5069cbd commit 179d66c
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/database.cpp
Expand Up @@ -31,19 +31,6 @@

namespace flexiblesusy {

namespace database {

/// convert number to string with maximum numeric precision
template <typename T>
std::string to_string(T number)
{
std::ostringstream out;
out << std::setprecision(std::numeric_limits<T>::digits10) << number;
return out.str();
}

} // namespace database

Database::Database(const std::string& file_name)
: db(open(file_name))
{
Expand Down Expand Up @@ -88,7 +75,7 @@ void Database::insert(
sql += ") VALUES (";

for (std::size_t i = 0; i < number_of_elements; i++) {
sql += database::to_string(data[i]);
sql += boost::lexical_cast<std::string>(data[i]);
if (i + 1 != number_of_elements)
sql += ',';
}
Expand Down

0 comments on commit 179d66c

Please sign in to comment.