[nft PATCH 2/4] segtree: Drop dead code in ei_insert()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Caller sorts new items to be added, therefore when checking for overlaps
the current range can only overlap on lower end. Drop the check for
upper end overlap.

Signed-off-by: Phil Sutter <phil@xxxxxx>
---
 src/segtree.c | 20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/src/segtree.c b/src/segtree.c
index aa1f1c38d789c..47e326533ac39 100644
--- a/src/segtree.c
+++ b/src/segtree.c
@@ -228,26 +228,6 @@ static int ei_insert(struct list_head *msgs, struct seg_tree *tree,
 				ei_destroy(lei);
 			}
 		}
-		if (rei != NULL) {
-			if (!merge)
-				goto err;
-			/*
-			 * Right endpoint is within rei, adjust it so we have:
-			 *
-			 * [new_left, new_right](new_right, rei_right]
-			 */
-			if (segtree_debug(tree->debug_mask)) {
-				pr_gmp_debug("adjust right [%Zx %Zx]\n",
-					     rei->left, rei->right);
-			}
-
-			mpz_add_ui(rei->left, new->right, 1);
-			mpz_sub(rei->size, rei->right, rei->left);
-			if (mpz_sgn(rei->size) < 0) {
-				ei_remove(tree, rei);
-				ei_destroy(rei);
-			}
-		}
 	}
 
 	__ei_insert(tree, new);
-- 
2.24.1




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux