Prefer swap() member function to std::swap. We were hitting the

inefficient generic std::swap for some derived types.
This commit is contained in:
ridiculousfish
2014-03-25 12:44:21 -07:00
parent a4cafaad2e
commit b520a03c57
4 changed files with 6 additions and 7 deletions

View File

@@ -350,7 +350,7 @@ bool plain_statement_get_expanded_command(const wcstring &src, const parse_node_
if (expand_one(cmd, EXPAND_SKIP_CMDSUBST | EXPAND_SKIP_VARIABLES | EXPAND_SKIP_JOBS))
{
/* Success, return the expanded string by reference */
std::swap(cmd, *out_cmd);
out_cmd->swap(cmd);
result = true;
}
}