From a3065a2b5815458e9a0892406baf3a73bcedd626 Mon Sep 17 00:00:00 2001 From: eadler Date: Mon, 4 Mar 2013 02:21:29 +0000 Subject: [PATCH] devd: Use simpler dst += *x instead of str.append(x, 1). Submitted by: Christoph Mallon Approved by: cperciva (mentor) --- sbin/devd/devd.cc | 12 ++++++------ 1 file 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)); }