diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2014-12-04 12:59:09 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2014-12-04 12:59:09 +0100 |
commit | b449b22abcceddab154e1694eb4f8ca8e392e35f (patch) | |
tree | a4dfeb8d2c52fe2877863625465dca385952dad1 /src/style | |
parent | 65451187f50de0ca5e76f0f10d7cfa51dac867c2 (diff) | |
download | qtlocation-mapboxgl-b449b22abcceddab154e1694eb4f8ca8e392e35f.tar.gz |
remove use of std::to_string in favor of boost::lexical_cast
std::to_string calls sprintf() internally, which is really slow
Diffstat (limited to 'src/style')
-rw-r--r-- | src/style/value.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/style/value.cpp b/src/style/value.cpp index bda9a089a8..ae51ce3783 100644 --- a/src/style/value.cpp +++ b/src/style/value.cpp @@ -1,11 +1,5 @@ #include <mbgl/style/value.hpp> - -#pragma GCC diagnostic push -#ifndef __clang__ -#pragma GCC diagnostic ignored "-Wunused-local-typedefs" -#endif -#include <boost/lexical_cast.hpp> -#pragma GCC diagnostic pop +#include <mbgl/util/string.hpp> mbgl::Value mbgl::parseValue(pbf data) { while (data.next()) @@ -37,9 +31,9 @@ mbgl::Value mbgl::parseValue(pbf data) { std::string mbgl::toString(const mbgl::Value& value) { if (value.is<std::string>()) return value.get<std::string>(); else if (value.is<bool>()) return value.get<bool>() ? "true" : "false"; - else if (value.is<int64_t>()) return std::to_string(value.get<int64_t>()); - else if (value.is<uint64_t>()) return std::to_string(value.get<uint64_t>()); - else if (value.is<double>()) return boost::lexical_cast<std::string>(value.get<double>()); + else if (value.is<int64_t>()) return util::toString(value.get<int64_t>()); + else if (value.is<uint64_t>()) return util::toString(value.get<uint64_t>()); + else if (value.is<double>()) return util::toString(value.get<double>()); else return "null"; } |