diff options
author | David Robillard <d@drobilla.net> | 2020-08-13 17:25:59 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-08-13 17:25:59 +0200 |
commit | d86638c91f89187f72afc532baf565ded0a29b7f (patch) | |
tree | edd779c47c341b7b37ee5ce10b8d3f5b23bb1d0a | |
parent | 92928586a32a122b5aae69bcc212e98d56a34cc0 (diff) | |
download | zix-d86638c91f89187f72afc532baf565ded0a29b7f.tar.gz zix-d86638c91f89187f72afc532baf565ded0a29b7f.tar.bz2 zix-d86638c91f89187f72afc532baf565ded0a29b7f.zip |
Fix duplicate branches
-rw-r--r-- | .clang-tidy | 1 | ||||
-rw-r--r-- | zix/tree.c | 4 |
2 files changed, 1 insertions, 4 deletions
diff --git a/.clang-tidy b/.clang-tidy index 91058d9..a454239 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -3,7 +3,6 @@ Checks: > -*-magic-numbers, -*-uppercase-literal-suffix, -android-cloexec-fopen, - -bugprone-branch-clone, -bugprone-suspicious-string-compare, -cert-err34-c, -cert-msc30-c, @@ -350,9 +350,7 @@ zix_tree_insert(ZixTree* t, void* e, ZixTreeIter** ti) cmp = t->cmp(e, n->data, t->cmp_data); if (cmp < 0) { n = n->left; - } else if (cmp > 0) { - n = n->right; - } else if (t->allow_duplicates) { + } else if (cmp > 0 || t->allow_duplicates) { n = n->right; } else { if (ti) { |