From 488cd78f3b30f8b43007a3250d0c11fd0416dde9 Mon Sep 17 00:00:00 2001 From: AkshayWarrier Date: Sat, 20 Jan 2024 22:42:58 +0530 Subject: tdf#158237 comphelper: Use C++20 contains() instead of find() and end() Change-Id: I99c27c2269051c6c145dbfd2ec12790d4bb1d5e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162338 Tested-by: Jenkins Reviewed-by: Hossein --- comphelper/source/container/embeddedobjectcontainer.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'comphelper') diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx index d20e99d6632b..a66ac2dec527 100644 --- a/comphelper/source/container/embeddedobjectcontainer.cxx +++ b/comphelper/source/container/embeddedobjectcontainer.cxx @@ -238,8 +238,7 @@ bool EmbeddedObjectContainer::HasEmbeddedObjects() const bool EmbeddedObjectContainer::HasEmbeddedObject( const OUString& rName ) { - auto aIt = pImpl->maNameToObjectMap.find( rName ); - if (aIt != pImpl->maNameToObjectMap.end()) + if (pImpl->maNameToObjectMap.contains(rName)) return true; if (!pImpl->mxStorage.is()) return false; @@ -256,8 +255,7 @@ bool EmbeddedObjectContainer::HasInstantiatedEmbeddedObject( const OUString& rNa // allows to detect whether the object was already instantiated // currently the filter instantiate it on loading, so this method allows // to avoid objects pointing to the same persistence - auto aIt = pImpl->maNameToObjectMap.find( rName ); - return ( aIt != pImpl->maNameToObjectMap.end() ); + return pImpl->maNameToObjectMap.contains(rName); } OUString EmbeddedObjectContainer::GetEmbeddedObjectName( const css::uno::Reference < css::embed::XEmbeddedObject >& xObj ) const -- cgit