pivot_stack_t *s;
s = talloc_zero(ctx, pivot_stack_t);
- if (!s) return NULL;
+ if (unlikely(!s)) return NULL;
s->data = talloc_array(s, fr_lst_index_t, INITIAL_STACK_CAPACITY);
- if (!s->data) {
+ if (unlikely(!s->data)) {
talloc_free(s);
return NULL;
}
lst->capacity = INITIAL_CAPACITY;
lst->p = talloc_array(lst, void *, lst->capacity);
- if (!lst->p) {
+ if (unlikely(!lst->p)) {
cleanup:
talloc_free(lst);
return NULL;
}
lst->s = stack_alloc(lst);
- if (!lst->s) goto cleanup;
+ if (unlikely(!lst->s)) goto cleanup;
/* Initially the LST is empty and we start at the beginning of the array */
stack_push(lst->s, 0);
if (is_bucket(lst, stack_index)) partition(lst, stack_index);
++stack_index;
if (lst_size(lst, stack_index) == 0) {
- void *min = pivot_item(lst, stack_index);
+ void *min = pivot_item(lst, stack_index);
lst_flatten(lst, stack_index);
bucket_delete(lst, stack_index, min);