prioq: use structrued initializer

This commit is contained in:
Yu Watanabe 2018-10-17 00:47:50 +09:00
parent e6e637a11a
commit 0cb3b295ec
1 changed files with 5 additions and 2 deletions

View File

@ -32,11 +32,14 @@ struct Prioq {
Prioq *prioq_new(compare_func_t compare_func) {
Prioq *q;
q = new0(Prioq, 1);
q = new(Prioq, 1);
if (!q)
return q;
q->compare_func = compare_func;
*q = (Prioq) {
.compare_func = compare_func,
};
return q;
}