summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-02-23 19:45:25 +0100
committerwm4 <wm4@nowhere>2020-02-23 19:45:25 +0100
commit758082a1f20c130ae3babdc7bc68abc2f4b9f8df (patch)
treeaa7bd9c4dee2ee8d7d2a1cc5a3454f4ad51adc79
parent4839106a996851d71f4170f06b1a0e869f3c5c88 (diff)
downloadmpv-758082a1f20c130ae3babdc7bc68abc2f4b9f8df.tar.bz2
mpv-758082a1f20c130ae3babdc7bc68abc2f4b9f8df.tar.xz
ta: minor simplification
Due to the ta_header.parent invariant, the "h->parent->child==h" check is always true.
-rw-r--r--ta/ta.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ta/ta.c b/ta/ta.c
index 95e8d4e3c5..7b6a6c7f91 100644
--- a/ta/ta.c
+++ b/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)