diff --git a/include/ada/url_pattern.h b/include/ada/url_pattern.h index 13466dd62..aa891d7f3 100644 --- a/include/ada/url_pattern.h +++ b/include/ada/url_pattern.h @@ -198,11 +198,11 @@ class url_pattern_component { // This function explicitly takes a std::string because it is moved. // To avoid unnecessary copy, move each value while calling the constructor. - url_pattern_component(std::string_view new_pattern, std::regex&& new_regexp, + url_pattern_component(std::string&& new_pattern, std::regex&& new_regexp, std::regex_constants::syntax_option_type new_flags, std::vector&& new_group_name_list, bool new_has_regexp_groups) - : regexp(new_regexp), + : regexp(std::move(new_regexp)), pattern(std::move(new_pattern)), flags(new_flags), group_name_list(new_group_name_list), diff --git a/src/url_pattern.cpp b/src/url_pattern.cpp index 7f1e80187..0b225f506 100644 --- a/src/url_pattern.cpp +++ b/src/url_pattern.cpp @@ -536,8 +536,9 @@ url_pattern_component::compile(std::string_view input, F encoding_callback, // Return a new component whose pattern string is pattern string, regular // expression is regular expression, group name list is name list, and has // regexp groups is has regexp groups. - return url_pattern_component(pattern_string, std::move(regular_expression), - flags, std::move(name_list), has_regexp_groups); + return url_pattern_component(std::move(pattern_string), + std::move(regular_expression), flags, + std::move(name_list), has_regexp_groups); } namespace url_pattern_helpers {