summaryrefslogtreecommitdiffstats
path: root/src/plugins/sqldrivers/oci
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2023-02-16 20:13:46 +0100
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2023-02-28 20:14:19 +0100
commit9b643bc6c9f1b97d8753848bcdc6d22f1272fabe (patch)
treeff60979a9afd354f3aa376951fba61eb30b1f407 /src/plugins/sqldrivers/oci
parent79b22bb1f3ba51f37de03faefc7ddcd712e8e385 (diff)
SQL: small optimization for SQLDriver::escapeIdentifier()
Avoid a memmove (and replace it with a memcpy) by not using QString::prepend() but create a completely new string object instead. Change-Id: Ibdb4a9c6b15b96f1743d47e158ff0fb9b2048221 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Diffstat (limited to 'src/plugins/sqldrivers/oci')
-rw-r--r--src/plugins/sqldrivers/oci/qsql_oci.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/sqldrivers/oci/qsql_oci.cpp b/src/plugins/sqldrivers/oci/qsql_oci.cpp
index c7d68e73f1..3dfb4f38d8 100644
--- a/src/plugins/sqldrivers/oci/qsql_oci.cpp
+++ b/src/plugins/sqldrivers/oci/qsql_oci.cpp
@@ -2753,8 +2753,8 @@ QString QOCIDriver::escapeIdentifier(const QString &identifier, IdentifierType t
QString res = identifier;
if (!identifier.isEmpty() && !isIdentifierEscaped(identifier, type)) {
res.replace(u'"', "\"\""_L1);
- res.prepend(u'"').append(u'"');
res.replace(u'.', "\".\""_L1);
+ res = u'"' + res + u'"';
}
return res;
}