Skip to content

Commit 9b0be9b

Browse files
committed
format
1 parent e2bde06 commit 9b0be9b

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

runtime-light/stdlib/string/pcre2-functions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ class compiled_regex {
6363
uint32_t named_groups_count() const noexcept;
6464
std::optional<string> replace(const string& subject, uint32_t replace_options, std::string_view replacement, uint32_t match_options, uint64_t limit,
6565
int64_t& replace_count) const noexcept;
66-
std::optional<string> replace_one(std::string_view subject, std::string_view replacement, string_buffer& sb, PCRE2_SIZE buffer_length,
67-
size_t offset, uint32_t options) const noexcept;
66+
std::optional<string> replace_one(std::string_view subject, std::string_view replacement, string_buffer& sb, PCRE2_SIZE buffer_length, size_t offset,
67+
uint32_t options) const noexcept;
6868

6969
private:
7070
compiled_regex(uint32_t compile_options, pcre2_code_8& regex_code) noexcept

runtime-light/stdlib/string/regex-functions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ class matcher {
231231

232232
while (true) {
233233
// Try to find match
234-
auto match_view_opt {m_compiled_regex->match(m_regex_info->subject, m_current_offset, m_match_options)};
234+
auto match_view_opt{m_compiled_regex->match(m_regex_info->subject, m_current_offset, m_match_options)};
235235
if (!match_view_opt.has_value()) {
236236
// std::nullopt means error
237237
m_has_error = true;

runtime-light/stdlib/string/regex-functions.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,8 @@ struct count_finalizer : vk::final_action<count_updater> {
7979
};
8080

8181
// returns the ending offset of the entire match
82-
PCRE2_SIZE set_matches(const kphp::pcre2::compiled_regex& compiled_regex, const kphp::pcre2::group_names_t& group_names,
83-
const pcre2::match_view& match_view, int64_t flags, std::optional<std::reference_wrapper<mixed>> opt_matches,
84-
trailing_unmatch last_unmatched_policy) noexcept;
82+
PCRE2_SIZE set_matches(const kphp::pcre2::compiled_regex& compiled_regex, const kphp::pcre2::group_names_t& group_names, const pcre2::match_view& match_view,
83+
int64_t flags, std::optional<std::reference_wrapper<mixed>> opt_matches, trailing_unmatch last_unmatched_policy) noexcept;
8584

8685
std::pair<string_buffer&, const PCRE2_SIZE> reserve_buffer(std::string_view subject) noexcept;
8786

@@ -221,8 +220,8 @@ kphp::coro::task<Optional<string>> f$preg_replace_callback(string pattern, F cal
221220
}
222221
auto group_names{compiled_regex->collect_group_names()};
223222
if (!co_await kphp::regex::replace_callback(regex_info, *compiled_regex, group_names, std::move(callback),
224-
limit == kphp::regex::PREG_REPLACE_NOLIMIT ? std::numeric_limits<uint64_t>::max() : static_cast<uint64_t>(limit), flags))
225-
[[unlikely]] {
223+
limit == kphp::regex::PREG_REPLACE_NOLIMIT ? std::numeric_limits<uint64_t>::max() : static_cast<uint64_t>(limit),
224+
flags)) [[unlikely]] {
226225
co_return Optional<string>{};
227226
}
228227
cf.count = regex_info.replace_count;

0 commit comments

Comments
 (0)