[Libreoffice-commits] core.git: connectivity/source
Lionel Elie Mamane (via logerrit)
logerrit at kemper.freedesktop.org
Fri Dec 18 07:49:13 UTC 2020
connectivity/source/drivers/postgresql/pq_connection.cxx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit b815bc466695cd1700a2c8d0cdc5201ed5a95032
Author: Lionel Elie Mamane <lionel at mamane.lu>
AuthorDate: Tue Nov 17 02:23:56 2020 +0100
Commit: Lionel Mamane <lionel at mamane.lu>
CommitDate: Fri Dec 18 08:48:29 2020 +0100
pgsql-sdbc small optimisation
1) use const unique_ptr since we don't need the value to survive the
scope in any way.
2) put the custom deleter function (PQconninfoFree) in the ptr class
rather than at runtime. Saves one pointer in the ptr class and
reduces the ptr class overhead...
Change-Id: I914baa0d8ae0426322fd343f5163d09f43c4c41c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105968
Tested-by: Jenkins
Reviewed-by: Lionel Mamane <lionel at mamane.lu>
diff --git a/connectivity/source/drivers/postgresql/pq_connection.cxx b/connectivity/source/drivers/postgresql/pq_connection.cxx
index 4d56d52ec9a9..5d97f2b2436d 100644
--- a/connectivity/source/drivers/postgresql/pq_connection.cxx
+++ b/connectivity/source/drivers/postgresql/pq_connection.cxx
@@ -453,7 +453,8 @@ void Connection::initialize( const Sequence< Any >& aArguments )
if ( o.getLength() > 0 )
{
char *err;
- std::shared_ptr<PQconninfoOption> oOpts(PQconninfoParse(o.getStr(), &err), PQconninfoFree);
+ const std::unique_ptr<PQconninfoOption, deleter_from_fn<PQconninfoFree>>
+ oOpts(PQconninfoParse(o.getStr(), &err));
if (oOpts == nullptr)
{
OUString errorMessage;
More information about the Libreoffice-commits
mailing list