[pango] pango: Remove some unnecessary NULL checks
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango] pango: Remove some unnecessary NULL checks
- Date: Thu, 16 Feb 2017 10:46:56 +0000 (UTC)
commit 4cd190eb567173c6d10419f379f2facb1a59d7eb
Author: Philip Withnall <withnall endlessm com>
Date: Wed Feb 15 09:41:14 2017 +0000
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
pango/pango-attributes.c | 3 ---
pango/pangofc-fontmap.c | 2 +-
2 files changed, 1 insertions(+), 4 deletions(-)
---
diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c
index b854431..df3104f 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 b73818b..da1738a 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]