changeset 28422:02a5da73a157

Use std::array rather than std::vector in patch for (bug #54334). * resource-manager.cc (update_network_settings): Replace std::vector, which can change size at runtime, with std::array, which does not.
author Rik <rik@octave.org>
date Tue, 09 Jun 2020 13:45:20 -0700
parents c648cca864db
children f5c9bb5955e7
files libgui/src/resource-manager.cc
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/resource-manager.cc	Mon Jun 08 21:59:17 2020 +0200
+++ b/libgui/src/resource-manager.cc	Tue Jun 09 13:45:20 2020 -0700
@@ -353,7 +353,6 @@
     if (m_settings->value (global_use_proxy.key, global_use_proxy.def).toBool ())
       {
         // Use a proxy, collect all required information
-
         QString proxy_type_string
             = m_settings->value (global_proxy_type.key, global_proxy_type.def).toString ();
 
@@ -390,16 +389,16 @@
               proxy_url.setPassword (pass);
           }
 
-        // The proxy data from the Environment variables
+        // The proxy data from environment variables
         if (proxy_type_string == global_proxy_all_types.at (2))
           {
-            const std::vector<std::string> env_vars = 
+            const std::array<std::string, 6> env_vars =
                 { "ALL_PROXY", "all_proxy",
                   "HTTP_PROXY", "http_proxy",
                   "HTTPS_PROXY", "https_proxy" };
 
             unsigned int count = 0;
-            while ((! proxy_url.isValid ()) && (count < env_vars.size ()))
+            while (! proxy_url.isValid () && count < env_vars.size ())
               {
                 proxy_url = QUrl (QString::fromStdString
                                     (sys::env::getenv (env_vars[count])));