Skip to content

Commit

Permalink
don't move function calls
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Dec 31, 2024
1 parent 7985050 commit ccd1734
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/ada/url_pattern_helpers-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ template <url_pattern_encoding_callback F>
tl::expected<std::vector<url_pattern_part>, url_pattern_errors>
parse_pattern_string(std::string_view input,
url_pattern_compile_component_options& options,
F&& encoding_callback) {
F& encoding_callback) {
ada_log("parse_pattern_string input=", input);
// Let parser be a new pattern parser whose encoding callback is encoding
// callback and segment wildcard regexp is the result of running generate a
Expand Down Expand Up @@ -706,7 +706,7 @@ parse_pattern_string(std::string_view input,
// Run add a part given parser, prefix, name token, regexp or wildcard
// token, the empty string, and modifier token.
if (auto error =
parser.add_part(prefix, name_token, regexp_or_wildcard_token, {},
parser.add_part(prefix, name_token, regexp_or_wildcard_token, "",
modifier_token)) {
ada_log("parser.add_part failed");
return tl::unexpected(*error);
Expand Down
6 changes: 3 additions & 3 deletions include/ada/url_pattern_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct Token {
template <url_pattern_encoding_callback F>
class url_pattern_parser {
public:
url_pattern_parser(F&& encoding_callback_,
url_pattern_parser(F& encoding_callback_,
std::string_view segment_wildcard_regexp_)
: encoding_callback(encoding_callback_),
segment_wildcard_regexp(std::string(segment_wildcard_regexp_)) {}
Expand Down Expand Up @@ -84,7 +84,7 @@ class url_pattern_parser {
bool is_duplicate_name(std::string_view name);

std::vector<Token> tokens{};
F encoding_callback;
F& encoding_callback;
std::string segment_wildcard_regexp;
std::vector<url_pattern_part> parts{};
std::string pending_fixed_value{};
Expand Down Expand Up @@ -310,7 +310,7 @@ template <url_pattern_encoding_callback F>
tl::expected<std::vector<url_pattern_part>, url_pattern_errors>
parse_pattern_string(std::string_view input,
url_pattern_compile_component_options& options,
F&& encoding_callback);
F& encoding_callback);

// @see https://urlpattern.spec.whatwg.org/#generate-a-pattern-string
std::string generate_pattern_string(
Expand Down

0 comments on commit ccd1734

Please sign in to comment.