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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Dec 28 18:30:43 UTC 2018


 connectivity/source/commontools/AutoRetrievingBase.cxx |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

New commits:
commit 863cff6e6765208acd5dcf6e43441e2e7156628a
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Sun Dec 9 20:23:20 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Fri Dec 28 19:30:20 2018 +0100

    Reduce number of potential OUString copy operations
    
    Change-Id: I45ca5a0b916a42fbf94c370ba5fb3ad3203c43b4
    Reviewed-on: https://gerrit.libreoffice.org/65668
    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 75cc214138b1..c99e6b5e82b1 100644
--- a/connectivity/source/commontools/AutoRetrievingBase.cxx
+++ b/connectivity/source/commontools/AutoRetrievingBase.cxx
@@ -39,13 +39,9 @@ namespace connectivity
             const sal_Int32 nTableIndex {sStatement.indexOf(sTable)};
             if ( nTableIndex>=0 )
             { // we need a table name
-                sal_Int32 nIntoIndex = sStmt.indexOf("INTO ");
-                sStmt = sStmt.copy(nIntoIndex+5);
-                while (sStmt.startsWith(" "))
-                {
-                    sStmt = sStmt.copy(1);
-                }
-                const OUString sTableName = sStmt.getToken(0, ' ');
+                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);
             }
         }


More information about the Libreoffice-commits mailing list