[Libreoffice-commits] core.git: Branch 'private/kohei/xlsx-import-speedup' - sc/source

Kohei Yoshida kohei.yoshida at collabora.com
Tue Nov 5 15:08:06 CET 2013


 sc/source/core/tool/address.cxx |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit d655c6d839abcc2a7eb1c7b6c5ad7cd98da716c2
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon Nov 4 23:31:51 2013 -0500

    Using OUStringBuffer is faster than chained += operator.
    
    Change-Id: I9991028ddd8ab6e2e43fe9a19428c9fdfbd38db6

diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index 4f465f9..039b256 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -65,6 +65,7 @@ static const sal_Unicode* lcl_ParseQuotedName( const sal_Unicode* p, OUString& r
     if (*p != '\'')
         return p;
 
+    OUStringBuffer aBuf;
     const sal_Unicode* pStart = p;
     sal_Unicode cPrev = 0;
     for (++p; *p; ++p)
@@ -74,19 +75,22 @@ static const sal_Unicode* lcl_ParseQuotedName( const sal_Unicode* p, OUString& r
             if (cPrev == '\'')
             {
                 // double single-quote equals one single quote.
-                rName += OUString(*p);
+                aBuf.append(*p);
                 cPrev = 0;
                 continue;
             }
         }
         else if (cPrev == '\'')
+        {
             // We are past the closing quote.  We're done!
+            rName = aBuf.makeStringAndClear();
             return p;
+        }
         else
-            rName += OUString(*p);
+            aBuf.append(*p);
         cPrev = *p;
     }
-    rName = "";
+
     return pStart;
 }
 


More information about the Libreoffice-commits mailing list