[librsvg: 2/48] rsvg-load: Remove superfluous checks for the vtable functions
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 2/48] rsvg-load: Remove superfluous checks for the vtable functions
- Date: Sat, 17 Nov 2018 10:20:11 +0000 (UTC)
commit 0319fa1145e0cd40a86e8513e33fa8b59ac320b9
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Aug 28 19:52:34 2018 -0500
rsvg-load: Remove superfluous checks for the vtable functions
All the RsvgSaxHandler vtables define all the functions; no need to
check for them.
librsvg/rsvg-load.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/librsvg/rsvg-load.c b/librsvg/rsvg-load.c
index 77f10a52..bc8d3f4f 100644
--- a/librsvg/rsvg-load.c
+++ b/librsvg/rsvg-load.c
@@ -613,8 +613,7 @@ sax_start_element_cb (void *data, const xmlChar * name, const xmlChar ** atts)
if (load->handler) {
load->handler_nest++;
- if (load->handler->start_element != NULL)
- load->handler->start_element (load->handler, (const char *) name, bag);
+ load->handler->start_element (load->handler, (const char *) name, bag);
} else {
const char *tempname;
for (tempname = (const char *) name; *tempname != '\0'; tempname++)
@@ -639,8 +638,7 @@ sax_end_element_cb (void *data, const xmlChar * xmlname)
const char *name = (const char *) xmlname;
if (load->handler_nest > 0 && load->handler != NULL) {
- if (load->handler->end_element != NULL)
- load->handler->end_element (load->handler, name);
+ load->handler->end_element (load->handler, name);
load->handler_nest--;
} else {
const char *tempname;
@@ -707,7 +705,7 @@ sax_characters_cb (void *data, const xmlChar * ch, int len)
{
RsvgLoad *load = data;
- if (load->handler && load->handler->characters != NULL) {
+ if (load->handler) {
load->handler->characters (load->handler, (const char *) ch, len);
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]