mirror of
https://github.com/mpv-player/mpv
synced 2024-11-03 03:19:24 +01:00
ta: minor simplification
Due to the ta_header.parent invariant, the "h->parent->child==h" check is always true.
This commit is contained in:
parent
4839106a99
commit
758082a1f2
3
ta/ta.c
3
ta/ta.c
@ -177,7 +177,6 @@ void *ta_realloc_size(void *ta_parent, void *ptr, size_t size)
|
||||
struct ta_header *old_h = h;
|
||||
if (h->size == size)
|
||||
return ptr;
|
||||
bool first_child = h->parent && h->parent->child == h;
|
||||
ta_dbg_remove(h);
|
||||
h = realloc(h, sizeof(union aligned_header) + size);
|
||||
ta_dbg_add(h ? h : old_h);
|
||||
@ -186,7 +185,7 @@ void *ta_realloc_size(void *ta_parent, void *ptr, size_t size)
|
||||
h->size = size;
|
||||
if (h != old_h) {
|
||||
// Relink parent
|
||||
if (first_child)
|
||||
if (h->parent)
|
||||
h->parent->child = h;
|
||||
// Relink siblings
|
||||
if (h->next)
|
||||
|
Loading…
Reference in New Issue
Block a user