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 c0db9c8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/ada/url_pattern.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class url_pattern_component {
// @see https://urlpattern.spec.whatwg.org/#compile-a-component
template <url_pattern_encoding_callback F>
static tl::expected<url_pattern_component, url_pattern_errors> compile(
std::string_view input, F encoding_callback,
std::string_view input, F& encoding_callback,
url_pattern_compile_component_options& options);

// @see https://urlpattern.spec.whatwg.org/#create-a-component-match-result
Expand Down
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
2 changes: 1 addition & 1 deletion src/url_pattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ std::string url_pattern_init::to_string() const {

template <url_pattern_encoding_callback F>
tl::expected<url_pattern_component, url_pattern_errors>
url_pattern_component::compile(std::string_view input, F encoding_callback,
url_pattern_component::compile(std::string_view input, F& encoding_callback,
url_pattern_compile_component_options& options) {
ada_log("url_pattern_component::compile input: ", input);
// Let part list be the result of running parse a pattern string given input,
Expand Down

0 comments on commit c0db9c8

Please sign in to comment.