- Avoid calling the copy constructor when it is not necessary.
This commit is contained in:
parent
a75716fc2d
commit
5bf0842244
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=210610
@ -264,7 +264,7 @@ match::~match()
|
|||||||
bool
|
bool
|
||||||
match::do_match(config &c)
|
match::do_match(config &c)
|
||||||
{
|
{
|
||||||
string value = c.get_variable(_var);
|
const string &value = c.get_variable(_var);
|
||||||
bool retval;
|
bool retval;
|
||||||
|
|
||||||
if (Dflag)
|
if (Dflag)
|
||||||
@ -577,7 +577,7 @@ void
|
|||||||
config::expand_one(const char *&src, string &dst)
|
config::expand_one(const char *&src, string &dst)
|
||||||
{
|
{
|
||||||
int count;
|
int count;
|
||||||
string buffer, varstr;
|
string buffer;
|
||||||
|
|
||||||
src++;
|
src++;
|
||||||
// $$ -> $
|
// $$ -> $
|
||||||
@ -615,8 +615,7 @@ config::expand_one(const char *&src, string &dst)
|
|||||||
buffer.append(src++, 1);
|
buffer.append(src++, 1);
|
||||||
} while (is_id_char(*src));
|
} while (is_id_char(*src));
|
||||||
buffer.append("", 1);
|
buffer.append("", 1);
|
||||||
varstr = get_variable(buffer.c_str());
|
dst.append(get_variable(buffer.c_str()));
|
||||||
dst.append(varstr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const string
|
const string
|
||||||
|
Loading…
Reference in New Issue
Block a user