Add and use OsmPlacemarkData::findTag(const QString& key)
ClosedPublic

Authored by kossebau on Sep 6 2016, 3:47 PM.

Details

Summary

Some code getting data from OsmPlacemarkData instances currently
does a double-lookup with data.containsTagKey(x) & data.tagValue(x).
As OsmPlacemarkData already exposes begin and end iterators for the
tags, adding a findTag(const QString &key) to allow single-lookup
of a tag on conditional access to its value seems matching.

Resulting code trades readability (IMHO) for speed, but for a library this
option seems to make sense.

Diff Detail

Repository
R34 Marble
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau updated this revision to Diff 6492.Sep 6 2016, 3:47 PM
kossebau retitled this revision from to Add and use OsmPlacemarkData::findTag(const QString& key).
kossebau updated this object.
nienhueser accepted this revision.Sep 6 2016, 6:19 PM
nienhueser edited edge metadata.

Looks good to me. I'm used to that pattern, so to me it doesn't degrade readability too much.

This revision is now accepted and ready to land.Sep 6 2016, 6:19 PM
This revision was automatically updated to reflect the committed changes.