[Libreoffice-commits] core.git: Branch 'private/kohei/calc-shared-string' - sc/source

Kohei Yoshida kohei.yoshida at collabora.com
Fri Oct 18 11:20:51 PDT 2013


 sc/source/core/tool/scmatrix.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 37ab84eb39d8ed38d779e58fa1a72cbd3ae65b45
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Fri Oct 18 12:37:24 2013 -0400

    vector with reserve() is slightly faster than deque here.
    
    Change-Id: I9c2203662daa586e3fdbc9650b6ff61365c5bc60

diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index a5487a7..b15866f 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -141,10 +141,13 @@ class CompareMatrixElemFunc : std::unary_function<MatrixImplType::element_block_
     static _Comp maComp;
 
     MatrixImplType maNewMat;
-    std::deque<bool> maNewMatValues;
+    std::vector<bool> maNewMatValues;
 public:
     CompareMatrixElemFunc( size_t nRow, size_t nCol ) :
-        maNewMat(nRow, nCol, false) {}
+        maNewMat(nRow, nCol, false)
+    {
+        maNewMatValues.reserve(nRow*nCol);
+    }
 
     void operator() (const MatrixImplType::element_block_node_type& node)
     {


More information about the Libreoffice-commits mailing list