summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <withnall@endlessm.com>2017-02-15 09:41:14 +0000
committerPhilip Withnall <withnall@endlessm.com>2017-02-16 10:46:44 +0000
commit4cd190eb567173c6d10419f379f2facb1a59d7eb (patch)
tree00fda330a66ac9de68c74bb2a4f96410b4f2dcfa
parentaf53ff59328aa175920e23c5c1b1fbcca0059921 (diff)
downloadpango-4cd190eb567173c6d10419f379f2facb1a59d7eb.tar.gz
pango: Remove some unnecessary NULL checks
These checks are preceded by other checks or code which demonstrates that the values are definitely always non-NULL. In the case of pango_attr_list_insert_internal(), the final branch of the function never needs to update list->attributes_tail, as the middle branch handles the case of appending to the list. The final case is just for insertions in the middle of the list. Coverity IDs: 1391710, 1391711 Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=778654
-rw-r--r--pango/pango-attributes.c3
-rw-r--r--pango/pangofc-fontmap.c2
2 files changed, 1 insertions, 4 deletions
diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c
index b8544316..df3104f0 100644
--- a/pango/pango-attributes.c
+++ b/pango/pango-attributes.c
@@ -1339,9 +1339,6 @@ pango_attr_list_insert_internal (PangoAttrList *list,
else
list->attributes = link;
- if (!tmp_list)
- list->attributes_tail = link;
-
break;
}
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index b73818b2..da1738ad 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -2347,7 +2347,7 @@ pango_fc_face_describe (PangoFontFace *face)
FcConfigSubstitute (NULL, match_pattern, FcMatchPattern);
FcDefaultSubstitute (match_pattern);
- if (fcface->family && fcface->family->fontmap)
+ if (fcface->family->fontmap)
config = fcface->family->fontmap->priv->config;
result_pattern = FcFontMatch (config, match_pattern, &res);