Revert "parser: try to avoid some strings being copied"

This reverts commit 7a74198aa3.

Believe it or not this commit actually increased copying. When accepting
a value you know you're going to take ownership of, just accept it by
value; then temporaries can invoke the move ctor and blah blah blah.

We really need a lightweight refcounted pass-by-value string to make this
less error prone.
This commit is contained in:
ridiculousfish
2019-04-01 20:19:28 -07:00
parent ab92baf671
commit dd007c29f4
4 changed files with 4 additions and 4 deletions

View File

@@ -1135,7 +1135,7 @@ const parse_node_t *parse_node_tree_t::get_child(const parse_node_t &parent, nod
return result;
}
parsed_source_ref_t parse_source(const wcstring &src, parse_tree_flags_t flags, parse_error_list_t *errors,
parsed_source_ref_t parse_source(wcstring src, parse_tree_flags_t flags, parse_error_list_t *errors,
parse_token_type_t goal) {
parse_node_tree_t tree;
if (!parse_tree_from_string(src, flags, &tree, errors, goal)) return {};