Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(452)

Unified Diff: lib/Parser_cpp.template

Issue 2843223005: [inspector_protocol] added StringUtil::toDouble method as requirement (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Parser_cpp.template
diff --git a/lib/Parser_cpp.template b/lib/Parser_cpp.template
index 4bf6bebc467eb4b0f5fdcc59f40e3d7d88f83b8a..ef180a1ce8ea110dd64b831b78198d32d88935fd 100644
--- a/lib/Parser_cpp.template
+++ b/lib/Parser_cpp.template
@@ -52,18 +52,13 @@ double charactersToDouble(const uint16_t* characters, size_t length, bool* ok)
}
buffer.push_back('\0');
char* endptr;
- double result = std::strtod(buffer.data(), &endptr);
- *ok = !(*endptr);
- return result;
+ return StringUtil::toDouble(buffer.data(), length, ok);
}
double charactersToDouble(const uint8_t* characters, size_t length, bool* ok)
{
std::string buffer(reinterpret_cast<const char*>(characters), length);
- char* endptr;
- double result = std::strtod(buffer.data(), &endptr);
- *ok = !(*endptr);
- return result;
+ return StringUtil::toDouble(buffer.data(), length, ok);
}
template<typename Char>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698