diff options
author | eadler <eadler@FreeBSD.org> | 2013-03-04 02:21:19 +0000 |
---|---|---|
committer | eadler <eadler@FreeBSD.org> | 2013-03-04 02:21:19 +0000 |
commit | 447034a196dd85fa9d26e5dd15075da57386eec5 (patch) | |
tree | af8874ab55078e93e98b25fc5884c908e23f6623 /sbin/devd | |
parent | 01afb73f51e847e1a23ce940b643a8dfeeb0e4e9 (diff) | |
download | FreeBSD-src-447034a196dd85fa9d26e5dd15075da57386eec5.zip FreeBSD-src-447034a196dd85fa9d26e5dd15075da57386eec5.tar.gz |
devd: Avoid unnecessary temporary objects (and simplify the code) when handling std::string.
Submitted by: Christoph Mallon <christoph.mallon@gmx.de>
Approved by: cperciva (mentor)
Diffstat (limited to 'sbin/devd')
-rw-r--r-- | sbin/devd/devd.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/devd/devd.cc b/sbin/devd/devd.cc index e1a52fc..16f9256 100644 --- a/sbin/devd/devd.cc +++ b/sbin/devd/devd.cc @@ -460,7 +460,7 @@ config::open_pidfile() { pid_t otherpid; - if (_pidfile == "") + if (_pidfile.empty()) return; pfh = pidfile_open(_pidfile.c_str(), 0600, &otherpid); if (pfh == NULL) { @@ -528,7 +528,7 @@ config::add_notify(int prio, event_proc *p) void config::set_pidfile(const char *fn) { - _pidfile = string(fn); + _pidfile = fn; } void @@ -617,7 +617,7 @@ config::expand_one(const char *&src, string &dst) do { buffer.append(src++, 1); } while (is_id_char(*src)); - dst.append(get_variable(buffer.c_str())); + dst.append(get_variable(buffer)); } const string |