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

John Zhang (via logerrit) logerrit at kemper.freedesktop.org
Thu Feb 13 10:23:13 UTC 2020


 connectivity/source/drivers/dbase/DDriver.cxx |   25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

New commits:
commit 03d2fa836ebd5f8c05d1bda99c01be45a57b65ea
Author:     John Zhang <mywtfmp3 at gmail.com>
AuthorDate: Sat Jan 11 13:16:17 2020 +0800
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Thu Feb 13 11:22:40 2020 +0100

    Prefer array over vector for 3 elements container
    
    Change-Id: I3d9bb84e067fdda3486ee21cfd5b5ffa59bc8c5c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86591
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/connectivity/source/drivers/dbase/DDriver.cxx b/connectivity/source/drivers/dbase/DDriver.cxx
index 3da4c0ce608c..ab2d52413e06 100644
--- a/connectivity/source/drivers/dbase/DDriver.cxx
+++ b/connectivity/source/drivers/dbase/DDriver.cxx
@@ -78,34 +78,35 @@ Sequence< DriverPropertyInfo > SAL_CALL ODriver::getPropertyInfo( const OUString
 {
     if ( acceptsURL(url) )
     {
-        std::vector< DriverPropertyInfo > aDriverInfo;
-
         Sequence< OUString > aBoolean(2);
         aBoolean[0] = "0";
         aBoolean[1] = "1";
 
-        aDriverInfo.push_back(DriverPropertyInfo(
+        DriverPropertyInfo aDriverInfo[] = {
+            {
                 "CharSet"
                 ,"CharSet of the database."
                 ,false
                 ,OUString()
-                ,Sequence< OUString >())
-                );
-        aDriverInfo.push_back(DriverPropertyInfo(
+                ,Sequence< OUString >()
+            },
+            {
                 "ShowDeleted"
                 ,"Display inactive records."
                 ,false
                 ,"0"
-                ,aBoolean)
-                );
-        aDriverInfo.push_back(DriverPropertyInfo(
+                ,aBoolean
+            },
+            {
                 "EnableSQL92Check"
                 ,"Use SQL92 naming constraints."
                 ,false
                 ,"0"
-                ,aBoolean)
-                );
-        return Sequence< DriverPropertyInfo >(aDriverInfo.data(),aDriverInfo.size());
+                ,aBoolean
+            }
+        };
+
+        return Sequence< DriverPropertyInfo >(aDriverInfo, std::size(aDriverInfo));
     }
 
     SharedResources aResources;


More information about the Libreoffice-commits mailing list