From d86638c91f89187f72afc532baf565ded0a29b7f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 13 Aug 2020 17:25:59 +0200 Subject: Fix duplicate branches --- .clang-tidy | 1 - zix/tree.c | 4 +--- 2 files changed, 1 insertion(+), 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, diff --git a/zix/tree.c b/zix/tree.c index 4dd0897..e0576fb 100644 --- a/zix/tree.c +++ b/zix/tree.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) { -- cgit v1.2.1