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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Dec 28 23:23:22 UTC 2018


 connectivity/source/commontools/AutoRetrievingBase.cxx |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit 08004507b53c99f9c67c95e33162adda5b19a6a6
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Sun Dec 9 21:09:59 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Sat Dec 29 00:23:00 2018 +0100

    Further reduction of OUString copy operations
    
    Change-Id: I79339e7cf8fa6b6a6f19ba598fc66d9e0df558ae
    Reviewed-on: https://gerrit.libreoffice.org/65669
    Tested-by: Jenkins
    Reviewed-by: Matteo Casalin <matteo.casalin at yahoo.com>

diff --git a/connectivity/source/commontools/AutoRetrievingBase.cxx b/connectivity/source/commontools/AutoRetrievingBase.cxx
index c99e6b5e82b1..d1170fdd972b 100644
--- a/connectivity/source/commontools/AutoRetrievingBase.cxx
+++ b/connectivity/source/commontools/AutoRetrievingBase.cxx
@@ -27,25 +27,24 @@ namespace connectivity
     {
         OSL_ENSURE( m_bAutoRetrievingEnabled,"Illegal call here. isAutoRetrievingEnabled is false!");
         OUString sStmt = _sInsertStatement.toAsciiUpperCase();
-        OUString sStatement;
         if ( sStmt.startsWith("INSERT") )
         {
-            sStatement = m_sGeneratedValueStatement;
             static const char sTable[] = "$table";
-            const sal_Int32 nColumnIndex {sStatement.indexOf("$column")};
+            const sal_Int32 nColumnIndex {m_sGeneratedValueStatement.indexOf("$column")};
             if ( nColumnIndex>=0 )
             { // we need a column
             }
-            const sal_Int32 nTableIndex {sStatement.indexOf(sTable)};
+            const sal_Int32 nTableIndex {m_sGeneratedValueStatement.indexOf(sTable)};
             if ( nTableIndex>=0 )
             { // we need a table name
                 sal_Int32 nIntoIndex = sStmt.indexOf("INTO ") + 5;
                 while (nIntoIndex<sStmt.getLength() && sStmt[nIntoIndex]==' ') ++nIntoIndex;
                 const OUString sTableName = sStmt.getToken(0, ' ', nIntoIndex);
-                sStatement = sStatement.replaceAt(nTableIndex, strlen(sTable), sTableName);
+                return m_sGeneratedValueStatement.replaceAt(nTableIndex, strlen(sTable), sTableName);
             }
+            return m_sGeneratedValueStatement;
         }
-        return sStatement;
+        return OUString();
     }
 }
 


More information about the Libreoffice-commits mailing list