Fixed build with older Google protocol buffers

This commit is contained in:
Martin Tůma 2019-01-01 21:45:53 +01:00
parent c8e8f0013f
commit 75e6da8903

View File

@ -47,12 +47,10 @@ const QVariant *PBF::Feature::value(const QString &key) const
if (it == keys.constEnd())
return 0;
const google::protobuf::RepeatedField<google::protobuf::uint32>
&tags(_data->tags());
google::protobuf::uint32 index = *it;
for (int i = 0; i < _data->tags_size(); i = i + 2)
if (tags[i] == index)
return &(_layer->values().at(tags[i+1]));
if (_data->tags(i) == index)
return &(_layer->values().at(_data->tags(i+1)));
return 0;
}