summaryrefslogtreecommitdiffstats
path: root/src/path.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-06-22 19:16:40 -0400
committerDavid Robillard <d@drobilla.net>2024-06-22 19:32:12 -0400
commit5f1c4d8ae807a33ceef342702bfff9a12ee6e251 (patch)
treee65d5f1a01610f6a30e13d1afcdcef38322d3a68 /src/path.c
parent2275a09f73046768a446b8dbb4d467de35b0f80b (diff)
downloadzix-5f1c4d8ae807a33ceef342702bfff9a12ee6e251.tar.gz
zix-5f1c4d8ae807a33ceef342702bfff9a12ee6e251.tar.bz2
zix-5f1c4d8ae807a33ceef342702bfff9a12ee6e251.zip
Remove redundant conditionals
Diffstat (limited to 'src/path.c')
-rw-r--r--src/path.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/path.c b/src/path.c
index c0140e4..404557a 100644
--- a/src/path.c
+++ b/src/path.c
@@ -356,10 +356,9 @@ zix_path_lexically_normal(ZixAllocator* const allocator, const char* const path)
size_t last = r;
size_t next = 0;
for (size_t i = root_len; i < r;) {
- if (last < r && i > 2 && i + 1 <= r && result[i - 2] == sep &&
- result[i - 1] == '.' && result[i] == '.' &&
- (!result[i + 1] || is_dir_sep(result[i + 1]))) {
- if (i < r && result[i + 1] == sep) {
+ if (last < r && i > 2U && result[i - 2U] == sep && result[i - 1U] == '.' &&
+ result[i] == '.' && (!result[i + 1U] || is_dir_sep(result[i + 1U]))) {
+ if (result[i + 1] == sep) {
++i;
}