Skip to content

Commit e82041b

Browse files
committed
stylesheet: No need to NULL guard lwc_string_unref
1 parent b0f4587 commit e82041b

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/stylesheet.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -854,8 +854,7 @@ css_error css__stylesheet_selector_destroy(css_stylesheet *sheet,
854854
d = c->combinator;
855855

856856
for (detail = &c->data; detail;) {
857-
if (detail->qname.ns != NULL)
858-
lwc_string_unref(detail->qname.ns);
857+
lwc_string_unref(detail->qname.ns);
859858
lwc_string_unref(detail->qname.name);
860859

861860
if (detail->value_type ==
@@ -874,8 +873,7 @@ css_error css__stylesheet_selector_destroy(css_stylesheet *sheet,
874873
}
875874

876875
for (detail = &selector->data; detail;) {
877-
if (detail->qname.ns != NULL)
878-
lwc_string_unref(detail->qname.ns);
876+
lwc_string_unref(detail->qname.ns);
879877
lwc_string_unref(detail->qname.name);
880878

881879
if (detail->value_type == CSS_SELECTOR_DETAIL_VALUE_STRING &&
@@ -1154,8 +1152,7 @@ css_error css__stylesheet_rule_destroy(css_stylesheet *sheet, css_rule *rule)
11541152
{
11551153
css_rule_import *import = (css_rule_import *) rule;
11561154

1157-
if (import->url != NULL)
1158-
lwc_string_unref(import->url);
1155+
lwc_string_unref(import->url);
11591156

11601157
if (import->media != NULL) {
11611158
css__mq_query_destroy(import->media);

0 commit comments

Comments
 (0)