diff options
author | lulf <lulf@FreeBSD.org> | 2010-07-29 16:06:40 +0000 |
---|---|---|
committer | lulf <lulf@FreeBSD.org> | 2010-07-29 16:06:40 +0000 |
commit | 87c9a96183cedc8ff5345a48039bd1369aee8a6a (patch) | |
tree | c083cb59ba019428161f4f808c11cbe7a16386ae /sbin | |
parent | 1b486040f01d7bae1a5d0a07ab7f05761ba28146 (diff) | |
download | FreeBSD-src-87c9a96183cedc8ff5345a48039bd1369aee8a6a.zip FreeBSD-src-87c9a96183cedc8ff5345a48039bd1369aee8a6a.tar.gz |
- Avoid calling the copy constructor when it is not necessary.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/devd/devd.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sbin/devd/devd.cc b/sbin/devd/devd.cc index c2ff49c..7af6f4e 100644 --- a/sbin/devd/devd.cc +++ b/sbin/devd/devd.cc @@ -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, string &dst) 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 |