[Midnightbsd-cvs] src [8521] trunk/sbin/devd: prefer the use of init lists

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Sep 18 19:00:19 EDT 2016


Revision: 8521
          http://svnweb.midnightbsd.org/src/?rev=8521
Author:   laffer1
Date:     2016-09-18 19:00:19 -0400 (Sun, 18 Sep 2016)
Log Message:
-----------
prefer the use of init lists

Modified Paths:
--------------
    trunk/sbin/devd/devd.cc
    trunk/sbin/devd/devd.hh

Modified: trunk/sbin/devd/devd.cc
===================================================================
--- trunk/sbin/devd/devd.cc	2016-09-18 22:59:52 UTC (rev 8520)
+++ trunk/sbin/devd/devd.cc	2016-09-18 23:00:19 UTC (rev 8521)
@@ -248,9 +248,8 @@
 }
 
 match::match(config &c, const char *var, const char *re)
-	: _var(var)
+	: _var(var), _re("^")
 {
-	_re = "^";
 	_re.append(c.expand_string(string(re)));
 	_re.append("$");
 	regcomp(&_regex, _re.c_str(), REG_EXTENDED | REG_NOSUB | REG_ICASE);

Modified: trunk/sbin/devd/devd.hh
===================================================================
--- trunk/sbin/devd/devd.hh	2016-09-18 22:59:52 UTC (rev 8520)
+++ trunk/sbin/devd/devd.hh	2016-09-18 23:00:19 UTC (rev 8521)
@@ -143,7 +143,7 @@
 class config
 {
 public:
-	config() { _pidfile = ""; push_var_table(); }
+	config() : _pidfile("") { push_var_table(); }
 	virtual ~config() { reset(); }
 	void add_attach(int, event_proc *);
 	void add_detach(int, event_proc *);



More information about the Midnightbsd-cvs mailing list