summaryrefslogtreecommitdiffstats
path: root/src/shrpx_router.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/shrpx_router.cc')
-rw-r--r--src/shrpx_router.cc8
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;