summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-05-03 17:08:24 +0200
committerMichael Stahl <mstahl@redhat.com>2017-05-03 17:13:03 +0200
commit489406e5ddb04a19f44b78c631aa3ad16be93a37 (patch)
tree7f88c2a48b8cb4245637b4d51267fd5d6d11f6c5 /tools
parente79ef12b7a904f17d4147fa409d055c12b70f952 (diff)
tools: don't use std::tie when comparing resources
This is unbelievably slow, Impress is basically unusable in a non-optimized build; every time you enter or leave text edit mode, some svx::sidebar::AreaPropertyPanel is created, which loads the color palette standard.soc, and there are lots of resource lookups for the strings in there; the std::tie and std::tuple::operator< make those 10x slower. (regression from d26f7537a57e4fc4c041db852b23c27149bc213d) Change-Id: I073b0187f6c173487e781a42c49631cb9ff2e625
Diffstat (limited to 'tools')
-rw-r--r--tools/source/rc/resmgr.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx
index 472b3c251907..422c7882d9a1 100644
--- a/tools/source/rc/resmgr.cxx
+++ b/tools/source/rc/resmgr.cxx
@@ -412,9 +412,11 @@ struct ImpContent
struct ImpContentLessCompare : public ::std::binary_function< ImpContent, ImpContent, bool>
{
- bool operator() (const ImpContent& lhs, const ImpContent& rhs) const
+ bool operator() (const ImpContent& rLhs, const ImpContent& rRhs) const
{
- return std::tie(lhs.nType, lhs.nId) < std::tie(rhs.nType, rhs.nId);
+ sal_uInt64 const lhs((static_cast<sal_uInt64>(rLhs.nType.get()) << 32) | rLhs.nId);
+ sal_uInt64 const rhs((static_cast<sal_uInt64>(rRhs.nType.get()) << 32) | rRhs.nId);
+ return lhs < rhs;
}
};