Use pass by value in string to double conversion

This commit is contained in:
Joakim Hove
2019-10-21 07:58:30 +02:00
parent 08d6888992
commit e02cce3fde

View File

@@ -429,9 +429,8 @@ std::vector<bool> readFormattedLogiArray(const std::string& file_str, const int
std::vector<double> readFormattedDoubArray(const std::string& file_str, const int size, long int fromPos)
{
std::function<double(const std::string&)> f = [](const std::string& value)
std::function<double(const std::string&)> f = [](std::string val)
{
std::string val(value);
int p1 = val.find_first_of("D");
if (p1 == -1) {