rbtree: drop "const" from search function
Having the search argument and result be "const" is nice in theory, but causes problems in practice. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
parent
674788166f
commit
ef11aa889b
2 changed files with 3 additions and 3 deletions
4
rbtree.c
4
rbtree.c
|
@ -12,9 +12,9 @@
|
||||||
|
|
||||||
#include "rbtree.h"
|
#include "rbtree.h"
|
||||||
|
|
||||||
const struct rbtree *rb_search(const struct rbtree *tree, uint64_t key)
|
struct rbtree *rb_search(struct rbtree *tree, uint64_t key)
|
||||||
{
|
{
|
||||||
const struct rbtree *best = NULL;
|
struct rbtree *best = NULL;
|
||||||
|
|
||||||
while (tree) {
|
while (tree) {
|
||||||
if (tree->key == key)
|
if (tree->key == key)
|
||||||
|
|
2
rbtree.h
2
rbtree.h
|
@ -14,6 +14,6 @@ struct rbtree {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rbtree *rb_insert(struct rbtree *, struct rbtree *);
|
struct rbtree *rb_insert(struct rbtree *, struct rbtree *);
|
||||||
const struct rbtree *rb_search(const struct rbtree *, uint64_t);
|
struct rbtree *rb_search(struct rbtree *, uint64_t);
|
||||||
|
|
||||||
#endif /* NASM_RBTREE_H */
|
#endif /* NASM_RBTREE_H */
|
||||||
|
|
Loading…
Reference in a new issue