summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDane Springmeyer <dane@mapbox.com>2016-04-20 13:14:13 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-04-20 13:14:13 -0700
commit74ad04499cc07d44770ca5fd60575d3269807235 (patch)
treef60162c0b4b6f5d054c9f8dc78c30e92ee8b0244
parentbf013e5cadcc6de86592a67c19fd8f55912b80f7 (diff)
downloadqtlocation-mapboxgl-74ad04499cc07d44770ca5fd60575d3269807235.tar.gz
[core] remove unused code in value.hpp (#4768)
Noticed this dead code while reviewing `mapbox::variant` usage with @artemp
-rw-r--r--src/mbgl/style/value.hpp23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/mbgl/style/value.hpp b/src/mbgl/style/value.hpp
index fd85ee36c4..c5be450916 100644
--- a/src/mbgl/style/value.hpp
+++ b/src/mbgl/style/value.hpp
@@ -15,29 +15,6 @@ std::string toString(const Value &value);
Value parseValue(const JSValue&);
-namespace util {
-inline bool parseNumericString(const std::string &str, double &result) {
- char *end = nullptr;
- const char *begin = str.c_str();
- result = std::strtod(begin, &end);
- while (*end != '\0' && isspace(*end)) end++; // eat whitespace after the end
- return errno == 0 && end - begin == long(str.size());
-}
-} // namespace util
-
-template <typename T>
-T toNumber(const Value &value) {
- if (value.is<std::string>()) {
- double val;
- return util::parseNumericString(value.get<std::string>(), val) ? val : 0;
- }
- else if (value.is<bool>()) return value.get<bool>();
- else if (value.is<int64_t>()) return value.get<int64_t>();
- else if (value.is<uint64_t>()) return value.get<uint64_t>();
- else if (value.is<double>()) return value.get<double>();
- else return 0;
-}
-
} // namespace mbgl
#endif