From e4c67ab0a7c5d8f8ac51eabf84233dc375a06a30 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kim=20Nguy=E1=BB=85n?= Date: Sun, 10 Mar 2013 19:05:36 +0100 Subject: [PATCH] Fix a nasty bug in PtSet module (intersect function was the one for little-endian patricia trees and therefore buggy) --- src/utils/ptset.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/ptset.ml b/src/utils/ptset.ml index 3de13bc..f9bbd03 100644 --- a/src/utils/ptset.ml +++ b/src/utils/ptset.ml @@ -15,7 +15,7 @@ (***********************************************************************) (* - Time-stamp: + Time-stamp: *) (* Modified by Kim Nguyen *) @@ -353,9 +353,9 @@ struct | Branch (p1,m1,l1,r1), Branch (p2,m2,l2,r2) -> if m1 == m2 && p1 == p2 then intersect l1 l2 || intersect r1 r2 - else if m1 < m2 && match_prefix p2 p1 m1 then + else if m1 > m2 && match_prefix p2 p1 m1 then intersect (if zero_bit p2 m1 then l1 else r1) s2 - else if m1 > m2 && match_prefix p1 p2 m2 then + else if m1 < m2 && match_prefix p1 p2 m2 then intersect s1 (if zero_bit p1 m2 then l2 else r2) else false -- 2.17.1