Skip to content

Commit ed0a1b3

Browse files
committed
avoid unnecessary copy
1 parent 58b6301 commit ed0a1b3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/ada/url_pattern_helpers-inl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,8 @@ tl::expected<std::vector<url_pattern_part>, errors> parse_pattern_string(
785785
template <url_pattern_regex::regex_concept regex_provider>
786786
bool protocol_component_matches_special_scheme(
787787
url_pattern_component<regex_provider>& component) {
788-
auto regex = component.regexp;
788+
// let's avoid unnecessary copy here.
789+
auto& regex = component.regexp;
789790
return regex_provider::regex_match("http", regex) ||
790791
regex_provider::regex_match("https", regex) ||
791792
regex_provider::regex_match("ws", regex) ||

0 commit comments

Comments
 (0)