Kaydet (Commit) 489406e5 authored tarafından Michael Stahl's avatar Michael Stahl

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 d26f7537)

Change-Id: I073b0187f6c173487e781a42c49631cb9ff2e625
üst e79ef12b
......@@ -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;
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment