mirror of
https://github.com/systemd/systemd
synced 2024-09-30 05:15:19 +00:00
strbuf: use CMP() macro
strbuf_child_entry.c is uint8_t, so using CMP() is safer. This also adds missing assertions.
This commit is contained in:
parent
1b3449d8c1
commit
7b12b86450
|
@ -74,9 +74,11 @@ struct strbuf* strbuf_free(struct strbuf *str) {
|
|||
return mfree(str);
|
||||
}
|
||||
|
||||
static int strbuf_children_cmp(const struct strbuf_child_entry *n1,
|
||||
const struct strbuf_child_entry *n2) {
|
||||
return n1->c - n2->c;
|
||||
static int strbuf_children_cmp(const struct strbuf_child_entry *n1, const struct strbuf_child_entry *n2) {
|
||||
assert(n1);
|
||||
assert(n2);
|
||||
|
||||
return CMP(n1->c, n2->c);
|
||||
}
|
||||
|
||||
static void bubbleinsert(struct strbuf_node *node,
|
||||
|
|
Loading…
Reference in a new issue