diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-12-03 12:07:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-12-04 07:01:53 +0100 |
commit | 8d84a0dc8d83cc7dbe77dec0bb4e2f6b9768e1d9 (patch) | |
tree | 28dda47bfa85f8e255bd18ac3f2ce2992a2de9ca /sc | |
parent | 60e8941fd581bb06cbf6be62edb8c387e7c07812 (diff) |
some std::set->o3tl::sorted_vector
which is much better cache-wise
Change-Id: Iacec0df48f043bcdd761ed30c1b1513850a00152
Reviewed-on: https://gerrit.libreoffice.org/84311
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/calcconfig.hxx | 4 | ||||
-rw-r--r-- | sc/source/core/tool/calcconfig.cxx | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sc/inc/calcconfig.hxx b/sc/inc/calcconfig.hxx index 646238051e73..29d926c459c4 100644 --- a/sc/inc/calcconfig.hxx +++ b/sc/inc/calcconfig.hxx @@ -13,8 +13,8 @@ #include "scdllapi.h" #include <memory> -#include <set> +#include <o3tl/sorted_vector.hxx> #include <formula/grammar.hxx> #include <formula/opcode.hxx> #include <rtl/ustring.hxx> @@ -64,7 +64,7 @@ struct SC_DLLPUBLIC ScCalcConfig OUString maOpenCLDevice; sal_Int32 mnOpenCLMinimumFormulaGroupSize; - typedef std::shared_ptr<std::set<OpCode>> OpCodeSet; + typedef std::shared_ptr<o3tl::sorted_vector<OpCode>> OpCodeSet; OpCodeSet mpOpenCLSubsetOpCodes; diff --git a/sc/source/core/tool/calcconfig.cxx b/sc/source/core/tool/calcconfig.cxx index 9f9bf35bacc0..72f86052c0ca 100644 --- a/sc/source/core/tool/calcconfig.cxx +++ b/sc/source/core/tool/calcconfig.cxx @@ -108,7 +108,7 @@ void ScCalcConfig::setOpenCLConfigToDefault() { // Keep in order of opcode value, is that clearest? (Random order, // at least, would make no sense at all.) - static OpCodeSet pDefaultOpenCLSubsetOpCodes(new std::set<OpCode>({ + static const OpCodeSet pDefaultOpenCLSubsetOpCodes(new o3tl::sorted_vector<OpCode>({ ocAdd, ocSub, ocNegSub, @@ -197,9 +197,9 @@ OUString ScOpCodeSetToSymbolicString(const ScCalcConfig::OpCodeSet& rOpCodes) formula::FormulaCompiler aCompiler; formula::FormulaCompiler::OpCodeMapPtr pOpCodeMap(aCompiler.GetOpCodeMap(css::sheet::FormulaLanguage::ENGLISH)); - for (auto i = rOpCodes->cbegin(); i != rOpCodes->cend(); ++i) + for (auto i = rOpCodes->begin(); i != rOpCodes->end(); ++i) { - if (i != rOpCodes->cbegin()) + if (i != rOpCodes->begin()) result.append(';'); result.append(pOpCodeMap->getSymbol(*i)); } @@ -209,7 +209,7 @@ OUString ScOpCodeSetToSymbolicString(const ScCalcConfig::OpCodeSet& rOpCodes) ScCalcConfig::OpCodeSet ScStringToOpCodeSet(const OUString& rOpCodes) { - ScCalcConfig::OpCodeSet result(new std::set< OpCode >); + ScCalcConfig::OpCodeSet result(new o3tl::sorted_vector< OpCode >); formula::FormulaCompiler aCompiler; formula::FormulaCompiler::OpCodeMapPtr pOpCodeMap(aCompiler.GetOpCodeMap(css::sheet::FormulaLanguage::ENGLISH)); |