Skip to content

Commit eb84151

Browse files
committed
select: autogenerator: No need to NULL guard lwc_string_unref
1 parent 1b1299b commit eb84151

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/select/autogenerated_propset.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,7 @@ static inline css_error set_background_image(css_computed_style *style, uint8_t
127127
style->i.background_image = NULL;
128128
}
129129

130-
if (old_string != NULL)
131-
lwc_string_unref(old_string);
130+
lwc_string_unref(old_string);
132131

133132
return CSS_OK;
134133
}
@@ -1440,8 +1439,7 @@ static inline css_error set_list_style_image(css_computed_style *style, uint8_t
14401439
style->i.list_style_image = NULL;
14411440
}
14421441

1443-
if (old_string != NULL)
1444-
lwc_string_unref(old_string);
1442+
lwc_string_unref(old_string);
14451443

14461444
return CSS_OK;
14471445
}

src/select/select_generator.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -588,10 +588,7 @@ def make_propset_h(self):
588588
t.indent(-1)
589589
t.append('}')
590590
t.append()
591-
t.append('if ({} != NULL)'.format(old_n))
592-
t.indent(1)
593591
t.append('lwc_string_unref({});'.format(old_n))
594-
t.indent(-1)
595592

596593
elif v.name == 'string_arr' or v.name == 'counter_arr':
597594
iter_var = 's' if v.name == 'string_arr' else 'c'

0 commit comments

Comments
 (0)