diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-12 11:52:05 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-12 18:03:46 +0200 |
commit | d03e7a8fba5494dc10433f33d902683eaae639bb (patch) | |
tree | 5ecd804d7330efbd0854235638d76fd504a1ccdd /connectivity/source | |
parent | e5c33076ab2a4d995e312908ca482b56dd502189 (diff) |
speed up simple use of NamedValueCollection
where instantiating and allocating a whole map just to extract a single
key is way inefficient
Change-Id: I55248bc71a9e8826cab9b76fa6916bfa888efa0b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134226
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity/source')
-rw-r--r-- | connectivity/source/commontools/dbmetadata.cxx | 3 | ||||
-rw-r--r-- | connectivity/source/drivers/mysql_jdbc/YDriver.cxx | 8 |
2 files changed, 5 insertions, 6 deletions
diff --git a/connectivity/source/commontools/dbmetadata.cxx b/connectivity/source/commontools/dbmetadata.cxx index 0a2123aaa782..7eb148735f31 100644 --- a/connectivity/source/commontools/dbmetadata.cxx +++ b/connectivity/source/commontools/dbmetadata.cxx @@ -135,8 +135,7 @@ namespace dbtools else { Reference< XDatabaseMetaData2 > xExtendedMetaData( _metaData.xConnectionMetaData, UNO_QUERY_THROW ); - ::comphelper::NamedValueCollection aSettings( xExtendedMetaData->getConnectionInfo() ); - _out_setting = aSettings.get( _asciiName ); + _out_setting = ::comphelper::NamedValueCollection::get( xExtendedMetaData->getConnectionInfo(), _asciiName ); return _out_setting.hasValue(); } return true; diff --git a/connectivity/source/drivers/mysql_jdbc/YDriver.cxx b/connectivity/source/drivers/mysql_jdbc/YDriver.cxx index ffe006c4b041..0f8357abd112 100644 --- a/connectivity/source/drivers/mysql_jdbc/YDriver.cxx +++ b/connectivity/source/drivers/mysql_jdbc/YDriver.cxx @@ -49,8 +49,8 @@ namespace { OUString getJavaDriverClass(css::uno::Sequence<css::beans::PropertyValue> const& info) { - return comphelper::NamedValueCollection(info).getOrDefault("JavaDriverClass", - OUString("com.mysql.jdbc.Driver")); + return comphelper::NamedValueCollection::getOrDefault(info, u"JavaDriverClass", + OUString("com.mysql.jdbc.Driver")); } } @@ -232,8 +232,8 @@ Reference<XConnection> SAL_CALL ODriverDelegator::connect(const OUString& url, Sequence<PropertyValue> aConvertedProperties = lcl_convertProperties(eType, info, url); if (eType == T_DRIVERTYPE::Jdbc) { - ::comphelper::NamedValueCollection aSettings(info); - OUString sIanaName = aSettings.getOrDefault("CharSet", OUString()); + OUString sIanaName = ::comphelper::NamedValueCollection::getOrDefault( + info, u"CharSet", OUString()); if (!sIanaName.isEmpty()) { ::dbtools::OCharsetMap aLookupIanaName; |