From eb2d3bb54a634ef181fc66201352ef72dbf0f6f6 Mon Sep 17 00:00:00 2001 From: Martchus Date: Sat, 19 Nov 2016 14:32:37 +0100 Subject: [PATCH] Check in hasField() whether field is empty --- fieldbasedtag.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fieldbasedtag.h b/fieldbasedtag.h index 1e9baea..8c1b814 100644 --- a/fieldbasedtag.h +++ b/fieldbasedtag.h @@ -187,7 +187,12 @@ inline bool FieldMapBasedTag::hasField(KnownField field) con template inline bool FieldMapBasedTag::hasField(const typename FieldType::identifierType &id) const { - return m_fields.count(id); + for (auto range = m_fields.equal_range(id); range.first != range.second; ++range.first) { + if(!range.first->second.value().isEmpty()) { + return true; + } + } + return false; } template