diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-29 21:23:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-01 09:09:34 +0200 |
commit | 12062cb281dce9b23bf643dce7744520cf8820f7 (patch) | |
tree | b52c70605401792385cd8e3f09d027594d5a0218 /include | |
parent | 0cc2ec0f0f2380d2c5456a5b8c9bb1789e832cde (diff) |
new loplugin:mapindex
Change-Id: I6b5f73b2187009e95d4d666e03e5803f522cee06
Reviewed-on: https://gerrit.libreoffice.org/76584
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/comphelper/IdPropArrayHelper.hxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/comphelper/IdPropArrayHelper.hxx b/include/comphelper/IdPropArrayHelper.hxx index 49c324beab2e..34e403b3ab0a 100644 --- a/include/comphelper/IdPropArrayHelper.hxx +++ b/include/comphelper/IdPropArrayHelper.hxx @@ -100,9 +100,10 @@ namespace comphelper OSL_ENSURE(s_nRefCount, "OIdPropertyArrayUsageHelper::getArrayHelper : suspicious call : have a refcount of 0 !"); ::osl::MutexGuard aGuard(OIdPropertyArrayUsageHelperMutex<TYPE>::get()); // do we have the array already? - if (! (*s_pMap)[nId] ) + auto& rEntry = (*s_pMap)[nId]; + if (!rEntry) { - (*s_pMap)[nId] = createArrayHelper(nId); + rEntry = createArrayHelper(nId); OSL_ENSURE((*s_pMap)[nId], "OIdPropertyArrayUsageHelper::getArrayHelper : createArrayHelper returned nonsense !"); } return (*s_pMap)[nId]; |