projects
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Mac build
[exim.git]
/
src
/
src
/
tree.c
diff --git
a/src/src/tree.c
b/src/src/tree.c
index 219a5358067e665fdde17182893acde433faba01..3b6c3603b0f0770ff5fc0d761f9dced6c757c762 100644
(file)
--- a/
src/src/tree.c
+++ b/
src/src/tree.c
@@
-1,10
+1,8
@@
-/* $Cambridge: exim/src/src/tree.c,v 1.4 2006/09/19 11:28:45 ph10 Exp $ */
-
/*************************************************
* Exim - an Internet mail transport agent *
*************************************************/
/*************************************************
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 20
06
*/
+/* Copyright (c) University of Cambridge 1995 - 20
15
*/
/* See the file NOTICE for conditions of use and distribution. */
/* Functions for maintaining binary balanced trees and some associated
/* See the file NOTICE for conditions of use and distribution. */
/* Functions for maintaining binary balanced trees and some associated
@@
-330,13
+328,13
@@
Returns: pointer to node, or NULL if not found
*/
tree_node *
*/
tree_node *
-tree_search(tree_node *p, uschar *name)
+tree_search(tree_node *p,
const
uschar *name)
{
{
-while (p
!= NULL
)
+while (p)
{
int c = Ustrcmp(name, p->name);
if (c == 0) return p;
{
int c = Ustrcmp(name, p->name);
if (c == 0) return p;
- p =
(c < 0)
? p->left : p->right;
+ p =
c < 0
? p->left : p->right;
}
return NULL;
}
}
return NULL;
}
@@
-357,10
+355,10
@@
Arguments:
void
tree_walk(tree_node *p, void (*f)(uschar*, uschar*, void*), void *ctx)
{
void
tree_walk(tree_node *p, void (*f)(uschar*, uschar*, void*), void *ctx)
{
-if (
p == NULL
) return;
+if (
!p
) return;
f(p->name, p->data.ptr, ctx);
f(p->name, p->data.ptr, ctx);
-
if (p->left != NULL)
tree_walk(p->left, f, ctx);
-
if (p->right != NULL)
tree_walk(p->right, f, ctx);
+tree_walk(p->left, f, ctx);
+tree_walk(p->right, f, ctx);
}
}