Skip to content

Commit

Permalink
Remove unnecessary default initialization of result since input strin…
Browse files Browse the repository at this point in the history
…g comes from parser and will always be parsable to a double
  • Loading branch information
lkeegan committed Nov 28, 2023
1 parent 8a388b6 commit 89ee5c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion symengine/parser/parser.cpp
Expand Up @@ -15,7 +15,7 @@ static double string_to_double(const char *str, char **endptr)
{
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
// use std::from_chars: locale-independent, non-allocating, non-throwing
double result{0.0};
double result;
auto [ptr, ec] = std::from_chars(str, nullptr, result);
if (endptr != nullptr) {
*endptr = const_cast<char *>(ptr);
Expand Down

0 comments on commit 89ee5c8

Please sign in to comment.