diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-11 16:46:30 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-11 16:46:30 +0000 |
commit | 854010bc34484a22f5e97ed21ea76e76cde6a9ca (patch) | |
tree | e2fe43eaaa3546c62c0fce539d775f9928c805f4 /src/shrpx_router.cc | |
parent | Adding debian version 1.61.0-1. (diff) | |
download | nghttp2-854010bc34484a22f5e97ed21ea76e76cde6a9ca.tar.xz nghttp2-854010bc34484a22f5e97ed21ea76e76cde6a9ca.zip |
Merging upstream version 1.62.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/shrpx_router.cc')
-rw-r--r-- | src/shrpx_router.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/shrpx_router.cc b/src/shrpx_router.cc index d3565db..559b236 100644 --- a/src/shrpx_router.cc +++ b/src/shrpx_router.cc @@ -67,7 +67,7 @@ void Router::add_node(RNode *node, const char *pattern, size_t patlen, ssize_t index, ssize_t wildcard_index) { auto pat = make_string_ref(balloc_, StringRef{pattern, patlen}); auto new_node = - std::make_unique<RNode>(pat.c_str(), pat.size(), index, wildcard_index); + std::make_unique<RNode>(pat.data(), pat.size(), index, wildcard_index); add_next_node(node, std::move(new_node)); } @@ -85,7 +85,7 @@ size_t Router::add_route(const StringRef &pattern, size_t idx, bool wildcard) { for (;;) { auto next_node = find_next_node(node, pattern[i]); if (next_node == nullptr) { - add_node(node, pattern.c_str() + i, pattern.size() - i, index, + add_node(node, pattern.data() + i, pattern.size() - i, index, wildcard_index); return idx; } @@ -93,7 +93,7 @@ size_t Router::add_route(const StringRef &pattern, size_t idx, bool wildcard) { node = next_node; auto slen = pattern.size() - i; - auto s = pattern.c_str() + i; + auto s = pattern.data() + i; auto n = std::min(node->len, slen); size_t j; for (j = 0; j < n && node->s[j] == s[j]; ++j) @@ -151,7 +151,7 @@ size_t Router::add_route(const StringRef &pattern, size_t idx, bool wildcard) { i += j; assert(pattern.size() > i); - add_node(node, pattern.c_str() + i, pattern.size() - i, index, + add_node(node, pattern.data() + i, pattern.size() - i, index, wildcard_index); return idx; |