summaryrefslogtreecommitdiffstats
path: root/src/H5TBprivate.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5TBprivate.h')
-rw-r--r--src/H5TBprivate.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/H5TBprivate.h b/src/H5TBprivate.h
index f66d87c..0e374e3 100644
--- a/src/H5TBprivate.h
+++ b/src/H5TBprivate.h
@@ -62,10 +62,11 @@ typedef int (*H5TB_cmp_t)(const void *k1, const void *k2, int cmparg);
# define Intern(n) ( LeftCnt(n) && RightCnt(n) )
# define UnBal(n) ( LeftCnt(n)>RightCnt(n) ? LEFT : \
LeftCnt(n)==RightCnt(n) ? 0 : RIGHT)
+# define UnBalanced(n) ( LeftCnt(n)!=RightCnt(n) ? 1 : 0)
# define Double(n) ( H5TB_DOUBLE & (n)->flags )
# define Other(side) ( LEFT + RIGHT - (side) )
-# define Delta(n,s) ( ( Heavy(n,s) ? 1 : -1 ) \
- * ( Double(n) ? 2 : UnBal(n) ? 1 : 0 ) )
+# define Weight(n) ( Double(n) ? 2 : UnBalanced(n) )
+# define Delta(n,s) ( Heavy(n,s) ? Weight(n) : -Weight(n) )
# define SetFlags(n,s,b,i) ( ( -2<(b) && (b)<2 ? 0 : H5TB_DOUBLE ) \
| ( 0>(b) ? H5TB_HEAVY(s) : (b)>0 ? H5TB_HEAVY(Other(s)) : 0 ) \
| ( (i) ? H5TB_INTERN : 0 ) )