svn commit: r210610 - head/sbin/devd
Ulf Lilleengen
lulf at FreeBSD.org
Thu Jul 29 16:06:40 UTC 2010
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
More information about the svn-src-all
mailing list