diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-05-13 18:51:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-15 08:48:06 +0200 |
commit | 4f6931d68664237f7f7eb1f55988b713034c77ba (patch) | |
tree | 35b71c92e3d0660890dd79648e9c1c62cdcc1610 /sfx2/source/view/classificationhelper.cxx | |
parent | 36e62098c8c541c4a3fb63eced591cf29ac56e4a (diff) |
use more try_emplace
specifically looking for the pattern
if (map.find(...) == map.end()
map[...] = value
Change-Id: I99f20d73f6e71a10726c9d39d8644c2e51120091
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94151
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/view/classificationhelper.cxx')
-rw-r--r-- | sfx2/source/view/classificationhelper.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sfx2/source/view/classificationhelper.cxx b/sfx2/source/view/classificationhelper.cxx index 1309bc774418..097cc20b4bdb 100644 --- a/sfx2/source/view/classificationhelper.cxx +++ b/sfx2/source/view/classificationhelper.cxx @@ -291,10 +291,8 @@ void SAL_CALL SfxClassificationParser::endElement(const OUString& rName) m_pCategory->m_nConfidentiality = m_aConfidentalityValue.toInt32(); // 0-based class sensitivity; 0 is lowest. // Set the two other type of levels as well, if they're not set // yet: they're optional in BAF, but not in BAILS. - if (rLabels.find("Impact:Level:Integrity") == rLabels.end()) - rLabels["Impact:Level:Integrity"] = m_aConfidentalityValue; - if (rLabels.find("Impact:Level:Availability") == rLabels.end()) - rLabels["Impact:Level:Availability"] = m_aConfidentalityValue; + rLabels.try_emplace("Impact:Level:Integrity", m_aConfidentalityValue); + rLabels.try_emplace("Impact:Level:Availability", m_aConfidentalityValue); } } else if (rName == "baf:Identifier") |