[Libreoffice-commits] core.git: 2 commits - connectivity/source

Lionel Elie Mamane lionel at mamane.lu
Fri Sep 19 03:13:30 PDT 2014


 connectivity/source/drivers/odbc/appendsqlwchars.cxx |    9 +++++----
 connectivity/source/drivers/odbc/appendsqlwchars.hxx |    4 ++--
 2 files changed, 7 insertions(+), 6 deletions(-)

New commits:
commit 1f291178605aea72a988d19db75500dfd2c23424
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Fri Sep 19 12:05:16 2014 +0200

    speed optimisation
    
    Change-Id: I8f27adf834e09702c609170e63facb1ec1ea0ab7

diff --git a/connectivity/source/drivers/odbc/appendsqlwchars.cxx b/connectivity/source/drivers/odbc/appendsqlwchars.cxx
index c083c61..8a62db3 100644
--- a/connectivity/source/drivers/odbc/appendsqlwchars.cxx
+++ b/connectivity/source/drivers/odbc/appendsqlwchars.cxx
@@ -26,9 +26,10 @@ void appendSQLWCHARs(OUStringBuffer & s, const sal_Unicode* d, sal_Int32 n)
 BOOST_STATIC_ASSERT(sizeof (wchar_t) == 4);
 void appendSQLWCHARs(OUStringBuffer & s, const wchar_t* d, sal_Int32 n)
 {
-    for (sal_Int32 i = 0; i < n; ++i)
+    const wchar_t * const end = d + n;
+    for (; d < end; ++d)
     {
-        s.appendUtf32(d[i]);
+        s.appendUtf32(*d);
     }
 }
 #endif
commit f3615c768c2d93b581eff7532c263a3905bb4785
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Fri Sep 19 12:04:54 2014 +0200

    constify
    
    Change-Id: If9866d25b228a5b84844943c17406c10f2c8515d

diff --git a/connectivity/source/drivers/odbc/appendsqlwchars.cxx b/connectivity/source/drivers/odbc/appendsqlwchars.cxx
index 09f39e2..c083c61 100644
--- a/connectivity/source/drivers/odbc/appendsqlwchars.cxx
+++ b/connectivity/source/drivers/odbc/appendsqlwchars.cxx
@@ -17,14 +17,14 @@
 
 namespace connectivity { namespace odbc {
 
-void appendSQLWCHARs(OUStringBuffer & s, sal_Unicode* d, sal_Int32 n)
+void appendSQLWCHARs(OUStringBuffer & s, const sal_Unicode* d, sal_Int32 n)
 {
     s.append(d, n);
 }
 
 #if defined SAL_UNICODE_NOTEQUAL_WCHAR_T
 BOOST_STATIC_ASSERT(sizeof (wchar_t) == 4);
-void appendSQLWCHARs(OUStringBuffer & s, wchar_t* d, sal_Int32 n)
+void appendSQLWCHARs(OUStringBuffer & s, const wchar_t* d, sal_Int32 n)
 {
     for (sal_Int32 i = 0; i < n; ++i)
     {
diff --git a/connectivity/source/drivers/odbc/appendsqlwchars.hxx b/connectivity/source/drivers/odbc/appendsqlwchars.hxx
index 1c31c72..b1424d1 100644
--- a/connectivity/source/drivers/odbc/appendsqlwchars.hxx
+++ b/connectivity/source/drivers/odbc/appendsqlwchars.hxx
@@ -17,10 +17,10 @@
 
 namespace connectivity { namespace odbc {
 
-void appendSQLWCHARs(OUStringBuffer & s, sal_Unicode* d, sal_Int32 n);
+void appendSQLWCHARs(OUStringBuffer & s, const sal_Unicode* d, sal_Int32 n);
 
 #if defined SAL_UNICODE_NOTEQUAL_WCHAR_T
-void appendSQLWCHARs(OUStringBuffer & s, wchar_t* d, sal_Int32 n);
+void appendSQLWCHARs(OUStringBuffer & s, const wchar_t* d, sal_Int32 n);
 #endif
 
 } }


More information about the Libreoffice-commits mailing list