svn commit: r246270 - stable/9/sbin/devd

Eitan Adler eadler at FreeBSD.org
Sat Feb 2 23:30:59 UTC 2013


Author: eadler
Date: Sat Feb  2 23:30:58 2013
New Revision: 246270
URL: http://svnweb.freebsd.org/changeset/base/246270

Log:
  MFC r243931:
  	Avoid the creation of a temporary object by using the prefix operator
  	for non-primitive types.
  
  Approved by:	cperciva (mentor, implicit)

Modified:
  stable/9/sbin/devd/devd.cc
Directory Properties:
  stable/9/sbin/devd/   (props changed)

Modified: stable/9/sbin/devd/devd.cc
==============================================================================
--- stable/9/sbin/devd/devd.cc	Sat Feb  2 23:22:39 2013	(r246269)
+++ stable/9/sbin/devd/devd.cc	Sat Feb  2 23:30:58 2013	(r246270)
@@ -127,7 +127,7 @@ delete_and_clear(vector<T *> &v)
 {
 	typename vector<T *>::const_iterator i;
 
-	for (i = v.begin(); i != v.end(); i++)
+	for (i = v.begin(); i != v.end(); ++i)
 		delete *i;
 	v.clear();
 }
@@ -155,7 +155,7 @@ event_proc::matches(config &c)
 {
 	vector<eps *>::const_iterator i;
 
-	for (i = _epsvec.begin(); i != _epsvec.end(); i++)
+	for (i = _epsvec.begin(); i != _epsvec.end(); ++i)
 		if (!(*i)->do_match(c))
 			return (false);
 	return (true);
@@ -166,7 +166,7 @@ event_proc::run(config &c)
 {
 	vector<eps *>::const_iterator i;
 		
-	for (i = _epsvec.begin(); i != _epsvec.end(); i++)
+	for (i = _epsvec.begin(); i != _epsvec.end(); ++i)
 		if (!(*i)->do_action(c))
 			return (false);
 	return (true);
@@ -291,7 +291,7 @@ media::media(config &, const char *var, 
 		{ -1,			"unknown" },
 		{ 0, NULL },
 	};
-	for (int i = 0; media_types[i].ifmt_string != NULL; i++)
+	for (int i = 0; media_types[i].ifmt_string != NULL; ++i)
 		if (strcasecmp(type, media_types[i].ifmt_string) == 0) {
 			_type = media_types[i].ifmt_word;
 			break;
@@ -444,7 +444,7 @@ config::parse(void)
 	vector<string>::const_iterator i;
 
 	parse_one_file(configfile);
-	for (i = _dir_list.begin(); i != _dir_list.end(); i++)
+	for (i = _dir_list.begin(); i != _dir_list.end(); ++i)
 		parse_files_in_dir((*i).c_str());
 	sort_vector(_attach_list);
 	sort_vector(_detach_list);
@@ -559,7 +559,7 @@ config::get_variable(const string &var)
 {
 	vector<var_list *>::reverse_iterator i;
 
-	for (i = _var_list_table.rbegin(); i != _var_list_table.rend(); i++) {
+	for (i = _var_list_table.rbegin(); i != _var_list_table.rend(); ++i) {
 		if ((*i)->is_set(var))
 			return ((*i)->get_variable(var));
 	}
@@ -716,7 +716,7 @@ config::find_and_execute(char type)
 	}
 	if (Dflag)
 		fprintf(stderr, "Processing %s event\n", s);
-	for (i = l->begin(); i != l->end(); i++) {
+	for (i = l->begin(); i != l->end(); ++i) {
 		if ((*i)->matches(*this)) {
 			(*i)->run(*this);
 			break;
@@ -813,14 +813,14 @@ notify_clients(const char *data, int len
 	list<int> bad;
 	list<int>::const_iterator i;
 
-	for (i = clients.begin(); i != clients.end(); i++) {
+	for (i = clients.begin(); i != clients.end(); ++i) {
 		if (write(*i, data, len) <= 0) {
 			bad.push_back(*i);
 			close(*i);
 		}
 	}
 
-	for (i = bad.begin(); i != bad.end(); i++)
+	for (i = bad.begin(); i != bad.end(); ++i)
 		clients.erase(find(clients.begin(), clients.end(), *i));
 }
 


More information about the svn-src-stable-9 mailing list