mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-28 23:30:01 +00:00
Merge pull request #280 from alexames/master
Removed call to pop_back on std::string.
This commit is contained in:
@@ -68,7 +68,8 @@ template<> inline std::string NumToString<double>(double t) {
|
|||||||
auto p = s.find_last_not_of('0');
|
auto p = s.find_last_not_of('0');
|
||||||
if (p != std::string::npos) {
|
if (p != std::string::npos) {
|
||||||
s.resize(p + 1); // Strip trailing zeroes.
|
s.resize(p + 1); // Strip trailing zeroes.
|
||||||
if (s.back() == '.') s.pop_back(); // Strip '.' if a whole number.
|
if (s.back() == '.')
|
||||||
|
s.erase(s.size() - 1, 1); // Strip '.' if a whole number.
|
||||||
}
|
}
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user