diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-12-09 20:23:20 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-12-28 19:30:20 +0100 |
commit | 863cff6e6765208acd5dcf6e43441e2e7156628a (patch) | |
tree | 09e494ba41c01bf4950ba56e4f6c2e8991407cdd /connectivity/source/commontools | |
parent | 5452f3bbf9de74497f4b1b1ff386fa1d6a4e7b7a (diff) |
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@yahoo.com>
Diffstat (limited to 'connectivity/source/commontools')
-rw-r--r-- | connectivity/source/commontools/AutoRetrievingBase.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
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); } } |