prioq: make prioq_reshuffle() void
We never use the return value, and it's confusing and kinda pointless what we return there. Hence drop it. Originally noticed by: tristone13th <tristone13th@outlook.com> Alternative to: #25810
This commit is contained in:
+2
-3
@@ -253,7 +253,7 @@ int prioq_remove(Prioq *q, void *data, unsigned *idx) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int prioq_reshuffle(Prioq *q, void *data, unsigned *idx) {
|
||||
void prioq_reshuffle(Prioq *q, void *data, unsigned *idx) {
|
||||
struct prioq_item *i;
|
||||
unsigned k;
|
||||
|
||||
@@ -261,12 +261,11 @@ int prioq_reshuffle(Prioq *q, void *data, unsigned *idx) {
|
||||
|
||||
i = find_item(q, data, idx);
|
||||
if (!i)
|
||||
return 0;
|
||||
return;
|
||||
|
||||
k = i - q->items;
|
||||
k = shuffle_down(q, k);
|
||||
shuffle_up(q, k);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void *prioq_peek_by_index(Prioq *q, unsigned idx) {
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ int prioq_ensure_allocated(Prioq **q, compare_func_t compare_func);
|
||||
int prioq_put(Prioq *q, void *data, unsigned *idx);
|
||||
int prioq_ensure_put(Prioq **q, compare_func_t compare_func, void *data, unsigned *idx);
|
||||
int prioq_remove(Prioq *q, void *data, unsigned *idx);
|
||||
int prioq_reshuffle(Prioq *q, void *data, unsigned *idx);
|
||||
void prioq_reshuffle(Prioq *q, void *data, unsigned *idx);
|
||||
|
||||
void *prioq_peek_by_index(Prioq *q, unsigned idx) _pure_;
|
||||
static inline void *prioq_peek(Prioq *q) {
|
||||
|
||||
Reference in New Issue
Block a user