Date: Sat, 2 Feb 2013 23:31:11 +0000 (UTC) From: Eitan Adler <eadler@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r246272 - stable/7/sbin/devd Message-ID: <201302022331.r12NVBYN042097@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: eadler Date: Sat Feb 2 23:31:10 2013 New Revision: 246272 URL: http://svnweb.freebsd.org/changeset/base/246272 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/7/sbin/devd/devd.cc Directory Properties: stable/7/sbin/devd/ (props changed) Modified: stable/7/sbin/devd/devd.cc ============================================================================== --- stable/7/sbin/devd/devd.cc Sat Feb 2 23:31:01 2013 (r246271) +++ stable/7/sbin/devd/devd.cc Sat Feb 2 23:31:10 2013 (r246272) @@ -96,7 +96,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(); } @@ -124,7 +124,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); @@ -135,7 +135,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); @@ -208,7 +208,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; @@ -360,7 +360,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); @@ -468,7 +468,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)); } @@ -626,7 +626,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; @@ -715,14 +715,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)); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302022331.r12NVBYN042097>