summaryrefslogtreecommitdiff
path: root/src/mbgl/style
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-08-26 13:46:54 +0200
committerKonstantin Käfer <mail@kkaefer.com>2016-09-15 14:05:23 +0200
commitd1d523686c01aacee1f1f9b6f6c7f22a6ff54d14 (patch)
tree45e6209ce30bf0e78d8b8690ead61e93befeb0a3 /src/mbgl/style
parentd6c958ba5fab8318be09d0c60a2eccd9ccbd7186 (diff)
downloadqtlocation-mapboxgl-d1d523686c01aacee1f1f9b6f6c7f22a6ff54d14.tar.gz
[core] upgrade RapidJSON to 1.1.0
Diffstat (limited to 'src/mbgl/style')
-rw-r--r--src/mbgl/style/parser.cpp12
-rw-r--r--src/mbgl/style/rapidjson_conversion.hpp6
2 files changed, 9 insertions, 9 deletions
diff --git a/src/mbgl/style/parser.cpp b/src/mbgl/style/parser.cpp
index e53fac2667..059082980d 100644
--- a/src/mbgl/style/parser.cpp
+++ b/src/mbgl/style/parser.cpp
@@ -113,11 +113,11 @@ void Parser::parseSources(const JSValue& value) {
return;
}
- for (auto it = value.MemberBegin(); it != value.MemberEnd(); ++it) {
- std::string id = *conversion::toString(it->name);
+ for (const auto& property : value.GetObject()) {
+ std::string id = *conversion::toString(property.name);
- conversion::Result<std::unique_ptr<Source>> source
- = conversion::convert<std::unique_ptr<Source>>(it->value, id);
+ conversion::Result<std::unique_ptr<Source>> source =
+ conversion::convert<std::unique_ptr<Source>>(property.value, id);
if (!source) {
Log::Warning(Event::ParseStyle, source.error().message);
continue;
@@ -136,9 +136,7 @@ void Parser::parseLayers(const JSValue& value) {
return;
}
- for (rapidjson::SizeType i = 0; i < value.Size(); ++i) {
- const JSValue& layerValue = value[i];
-
+ for (auto& layerValue : value.GetArray()) {
if (!layerValue.IsObject()) {
Log::Warning(Event::ParseStyle, "layer must be an object");
continue;
diff --git a/src/mbgl/style/rapidjson_conversion.hpp b/src/mbgl/style/rapidjson_conversion.hpp
index ecf044fb64..101fe67ec0 100644
--- a/src/mbgl/style/rapidjson_conversion.hpp
+++ b/src/mbgl/style/rapidjson_conversion.hpp
@@ -37,8 +37,10 @@ inline const JSValue* objectMember(const JSValue& value, const char * name) {
template <class Fn>
optional<Error> eachMember(const JSValue& value, Fn&& fn) {
- for (auto it = value.MemberBegin(); it != value.MemberEnd(); ++it) {
- optional<Error> result = fn({it->name.GetString(), it->name.GetStringLength()}, it->value);
+ assert(value.IsObject());
+ for (const auto& property : value.GetObject()) {
+ optional<Error> result =
+ fn({ property.name.GetString(), property.name.GetStringLength() }, property.value);
if (result) {
return result;
}