summaryrefslogtreecommitdiffstats
path: root/bridges
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-10-28 11:37:07 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-10-28 14:35:26 +0200
commit601d0577245e5d85211da96736609a48146c847e (patch)
tree094c9babccaa901b5d912e1a1148e75ac04547ca /bridges
parentloplugin:simplifybool (clang-cl) (diff)
downloadcore-601d0577245e5d85211da96736609a48146c847e.tar.gz
core-601d0577245e5d85211da96736609a48146c847e.zip
Revert broken optimization attempt
This partially reverts 1a5b12aa5da2c718848d3cc5d9bce7bfcdeacf54 "optimise find/insert pattern", which caused > ~/llvm/inst/bin/../include/c++/v1/unordered_map:1134: _LIBCPP_ASSERT '__get_const_db()->__find_c_from_i(&__p) == this' failed. unordered_map::insert(const_iterator, const value_type&) called with an iterator not referring to this unordered_map during CustomTarget_testtools/uno_test in an experimental build with -D_LIBCPP_DEBUG=1 on macOS. Change-Id: Id40e5eab7c3fb1f8e1bb2599c7fb84649e870ba2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124319 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'bridges')
-rw-r--r--bridges/source/cpp_uno/shared/vtablefactory.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx b/bridges/source/cpp_uno/shared/vtablefactory.cxx
index a8aa7a9c2bfa..53b516cded5a 100644
--- a/bridges/source/cpp_uno/shared/vtablefactory.cxx
+++ b/bridges/source/cpp_uno/shared/vtablefactory.cxx
@@ -188,12 +188,11 @@ sal_Int32 VtableFactory::BaseOffset::calculate(
typelib_InterfaceTypeDescription * type, sal_Int32 offset)
{
OUString name(type->aBase.pTypeName);
- auto it = m_map.find(name);
- if (it == m_map.end()) {
+ if (m_map.find(name) == m_map.end()) {
for (sal_Int32 i = 0; i < type->nBaseTypes; ++i) {
offset = calculate(type->ppBaseTypes[i], offset);
}
- m_map.insert(it, {name, offset});
+ m_map.insert({name, offset});
typelib_typedescription_complete(
reinterpret_cast< typelib_TypeDescription ** >(&type));
offset += bridges::cpp_uno::shared::getLocalFunctions(type);