Date: Thu, 29 Jul 2010 16:06:40 +0000 (UTC) From: Ulf Lilleengen <lulf@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r210610 - head/sbin/devd Message-ID: <201007291606.o6TG6e0V087955@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: lulf Date: Thu Jul 29 16:06:40 2010 New Revision: 210610 URL: http://svn.freebsd.org/changeset/base/210610 Log: - Avoid calling the copy constructor when it is not necessary. Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Thu Jul 29 16:01:10 2010 (r210609) +++ head/sbin/devd/devd.cc Thu Jul 29 16:06:40 2010 (r210610) @@ -264,7 +264,7 @@ match::~match() bool match::do_match(config &c) { - string value = c.get_variable(_var); + const string &value = c.get_variable(_var); bool retval; if (Dflag) @@ -577,7 +577,7 @@ void config::expand_one(const char *&src, string &dst) { int count; - string buffer, varstr; + string buffer; src++; // $$ -> $ @@ -615,8 +615,7 @@ config::expand_one(const char *&src, str buffer.append(src++, 1); } while (is_id_char(*src)); buffer.append("", 1); - varstr = get_variable(buffer.c_str()); - dst.append(varstr); + dst.append(get_variable(buffer.c_str())); } const string
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007291606.o6TG6e0V087955>