Commit 784756e0 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Neuter the VRBT_AUGMENT facility if not used.

parent 333a1a0c
......@@ -366,7 +366,16 @@ struct { \
* from the bottom up to the root, to update augmented node data.
*/
#ifndef VRBT_AUGMENT
#define VRBT_AUGMENT(x) break
#define VRBT_AUGMENT(x) do {} while (0)
#define VRBT_AUGMENT_UP(x) do {} while (0)
#else
#define VRBT_AUGMENT_UP(x) \
do { \
while((x) != NULL) { \
VRBT_AUGMENT(x); \
x = VRBT_PARENT(x, field); \
} \
} while (0)
#endif
#define VRBT_SWAP_CHILD(head, out, in, field) do { \
......@@ -627,10 +636,7 @@ name##_VRBT_REMOVE(struct name *head, struct type *elm) \
VRBT_SET_PARENT(child, parent, field); \
if (parent != NULL) \
name##_VRBT_REMOVE_COLOR(head, parent, child); \
while (parent != NULL) { \
VRBT_AUGMENT(parent); \
parent = VRBT_PARENT(parent, field); \
} \
VRBT_AUGMENT_UP(parent); \
return (old); \
}
......@@ -661,10 +667,7 @@ name##_VRBT_INSERT(struct name *head, struct type *elm) \
else \
VRBT_RIGHT(parent, field) = elm; \
name##_VRBT_INSERT_COLOR(head, elm); \
while (elm != NULL) { \
VRBT_AUGMENT(elm); \
elm = VRBT_PARENT(elm, field); \
} \
VRBT_AUGMENT_UP(elm); \
return (NULL); \
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment