]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: ebtree: add new eb_next_dup/eb_prev_dup() functions to visit duplicates
authorWilly Tarreau <w@1wt.eu>
Tue, 7 May 2013 13:58:28 +0000 (15:58 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 7 May 2013 14:10:02 +0000 (16:10 +0200)
commit2b5702030daf1f6394cc7c7e0c2cda9ef90ae2e1
tree3fae0b3ed61282502cfe5677425425123104d4f0
parent2ddccb7ed415120e8ef7dfc4b59bc1b43d475e04
MINOR: ebtree: add new eb_next_dup/eb_prev_dup() functions to visit duplicates

Sometimes it's very useful to visit duplicates of a same node, but doing
so from the application is not convenient because keys have to be compared,
while all the information is available during the next/prev steps.

Let's introduce a couple of new eb_next_dup/eb_prev_dup functions to visit
only duplicates of the current node and return NULL once it's done. Now we
have all 3 combinations :
  - next        : returns next node in the tree
  - next_dup    : returns next dup in the sub-tree
  - next_unique : returns next value after skipping dups

(cherry picked from commit 3327b8ae6866f3878322a1a29e70b450226d216d)
ebtree/eb32tree.h
ebtree/eb64tree.h
ebtree/ebmbtree.h
ebtree/ebpttree.h
ebtree/ebtree.h