Check in hasField() whether field is empty

This commit is contained in:
Martchus 2016-11-19 14:32:37 +01:00
parent 820078bb15
commit eb2d3bb54a
1 changed files with 6 additions and 1 deletions

View File

@ -187,7 +187,12 @@ inline bool FieldMapBasedTag<FieldType, Compare>::hasField(KnownField field) con
template <class FieldType, class Compare>
inline bool FieldMapBasedTag<FieldType, Compare>::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 <class FieldType, class Compare>