aboutsummaryrefslogtreecommitdiff
path: root/sbin/devd
diff options
context:
space:
mode:
authorEitan Adler <eadler@FreeBSD.org>2013-03-04 02:21:29 +0000
committerEitan Adler <eadler@FreeBSD.org>2013-03-04 02:21:29 +0000
commit7d9e9c60a08f6641304aeea53bc2584c0116420c (patch)
tree2df83cebb3454a484ed658d21901301908918588 /sbin/devd
parenta6393aa163cfa598e5f1c5cb386cef017bd67dec (diff)
downloadsrc-7d9e9c60a08f6641304aeea53bc2584c0116420c.tar.gz
src-7d9e9c60a08f6641304aeea53bc2584c0116420c.zip
devd: Use simpler dst += *x instead of str.append(x, 1).
Submitted by: Christoph Mallon <christoph.mallon@gmx.de> Approved by: cperciva (mentor)
Notes
Notes: svn path=/head/; revision=247762
Diffstat (limited to 'sbin/devd')
-rw-r--r--sbin/devd/devd.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/sbin/devd/devd.cc b/sbin/devd/devd.cc
index b52bf22de0aa..405720ba8774 100644
--- a/sbin/devd/devd.cc
+++ b/sbin/devd/devd.cc
@@ -585,7 +585,7 @@ config::expand_one(const char *&src, string &dst)
src++;
// $$ -> $
if (*src == '$') {
- dst.append(src++, 1);
+ dst += *src++;
return;
}
@@ -593,7 +593,7 @@ config::expand_one(const char *&src, string &dst)
// Not sure if I want to support this or not, so for now we just pass
// it through.
if (*src == '(') {
- dst.append("$");
+ dst += '$';
count = 1;
/* If the string ends before ) is matched , return. */
while (count > 0 && *src) {
@@ -601,21 +601,21 @@ config::expand_one(const char *&src, string &dst)
count--;
else if (*src == '(')
count++;
- dst.append(src++, 1);
+ dst += *src++;
}
return;
}
// ${^A-Za-z] -> $\1
if (!isalpha(*src)) {
- dst.append("$");
- dst.append(src++, 1);
+ dst += '$';
+ dst += *src++;
return;
}
// $var -> replace with value
do {
- buffer.append(src++, 1);
+ buffer += *src++;
} while (is_id_char(*src));
dst.append(get_variable(buffer));
}