mirror of
https://github.com/ToruNiina/toml11.git
synced 2024-11-26 14:20:05 +00:00
style: remove needless type casting
This commit is contained in:
parent
dddcecb034
commit
46b35870c5
@ -32,9 +32,9 @@ struct serializer
|
||||
std::string operator()(const toml::floating f) const
|
||||
{
|
||||
const auto fmt = "%.*g";
|
||||
const auto bsz = std::snprintf(nullptr, 0, fmt, int(this->float_prec_), f);
|
||||
const auto bsz = std::snprintf(nullptr, 0, fmt, this->float_prec_, f);
|
||||
std::vector<char> buf(bsz + 1, '\0'); // +1 for null character(\0)
|
||||
std::snprintf(buf.data(), buf.size(), fmt, int(this->float_prec_), f);
|
||||
std::snprintf(buf.data(), buf.size(), fmt, this->float_prec_, f);
|
||||
|
||||
std::string token(buf.begin(), buf.end());
|
||||
if(token.back() == '.') // 1. => 1.0
|
||||
|
Loading…
Reference in New Issue
Block a user