changeset 17653:d8d71c89fff2

eliminate unnecessary member variable in url_base_transfer class * url-transfer.h, url-transfer.cc (base_url_transfer::userpw): Delete member variable. (curl_transfer::init): Declare userpwd as a local variable.
author John W. Eaton <jwe@octave.org>
date Mon, 07 Oct 2013 22:35:55 -0400
parents e5932e528721
children f5950975a172
files liboctave/util/url-transfer.cc liboctave/util/url-transfer.h
diffstat 2 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/util/url-transfer.cc
+++ b/liboctave/util/url-transfer.cc
@@ -658,7 +658,7 @@
     SETOPT (CURLOPT_NOBODY, 1);
 
     // Set the username and password
-    userpwd = user;
+    std::string userpwd = user;
     if (! passwd.empty ())
       userpwd += ":" + passwd;
     if (! userpwd.empty ())
--- a/liboctave/util/url-transfer.h
+++ b/liboctave/util/url-transfer.h
@@ -47,7 +47,7 @@
   friend class url_transfer;
 
   base_url_transfer (void)
-    : count (1), host_or_url (), userpwd (), valid (false), ftp (false),
+    : count (1), host_or_url (), valid (false), ftp (false),
       ascii_mode (false), ok (true), errmsg (),
       curr_istream (&std::cin), curr_ostream (&std::cout)
   { }
@@ -56,12 +56,12 @@
                      const std::string& /* user_arg */,
                      const std::string& /* passwd */,
                      std::ostream& os)
-    : count (1), host_or_url (host), userpwd (), valid (false), ftp (true),
+    : count (1), host_or_url (host), valid (false), ftp (true),
       ascii_mode (false), ok (true), errmsg (), curr_istream (&std::cin),
       curr_ostream (&os) { }
 
   base_url_transfer (const std::string& url, std::ostream& os)
-    : count (1), host_or_url (url), userpwd (), valid (false), ftp (false),
+    : count (1), host_or_url (url), valid (false), ftp (false),
       ascii_mode (false), ok (true), errmsg (),
       curr_istream (&std::cin), curr_ostream (&os) { }
 
@@ -141,7 +141,6 @@
 
   // Host for ftp transfers or full URL for http requests.
   std::string host_or_url;
-  std::string userpwd;
   bool valid;
   bool ftp;
   bool ascii_mode;