From 70277ccdb3035db83d81d942777c12a60c4aded3 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 26 Feb 2023 12:39:18 -0500 Subject: Rename string view fields --- src/uri_utils.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/uri_utils.h') diff --git a/src/uri_utils.h b/src/uri_utils.h index 3974b5ce..ebc32b78 100644 --- a/src/uri_utils.h +++ b/src/uri_utils.h @@ -19,23 +19,23 @@ typedef struct { static inline bool slice_equals(const SerdStringView* a, const SerdStringView* b) { - return a->len == b->len && !strncmp(a->buf, b->buf, a->len); + return a->length == b->length && !strncmp(a->data, b->data, a->length); } static inline size_t uri_path_len(const SerdURIView* uri) { - return uri->path_base.len + uri->path.len; + return uri->path_base.length + uri->path.length; } static inline char uri_path_at(const SerdURIView* uri, size_t i) { - if (i < uri->path_base.len) { - return uri->path_base.buf[i]; + if (i < uri->path_base.length) { + return uri->path_base.data[i]; } - return uri->path.buf[i - uri->path_base.len]; + return uri->path.data[i - uri->path_base.length]; } /** @@ -51,7 +51,7 @@ uri_rooted_index(const SerdURIView* uri, const SerdURIView* root) { SlashIndexes indexes = {SIZE_MAX, SIZE_MAX}; - if (!root || !root->scheme.len || + if (!root || !root->scheme.length || !slice_equals(&root->scheme, &uri->scheme) || !slice_equals(&root->authority, &uri->authority)) { return indexes; -- cgit v1.2.1