summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-06-15 09:31:51 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-06-15 09:31:51 +0100
commit297fa2bca00e11a6c0ffabaf89a4899e73ccf957 (patch)
treeb9619fb4be9c5202114ca48c9c33874130e668e5
parentb5ed76ba9f22ea659e9e6a3daa32c68354920455 (diff)
optimize - avoid eina_inlist_last where not needed
really minor places.
-rw-r--r--src/lib/eldbus/eldbus_introspection.c4
-rw-r--r--src/lib/evas/filters/evas_filter_parser.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/eldbus/eldbus_introspection.c b/src/lib/eldbus/eldbus_introspection.c
index 4338860..98ea865 100644
--- a/src/lib/eldbus/eldbus_introspection.c
+++ b/src/lib/eldbus/eldbus_introspection.c
@@ -31,12 +31,14 @@ eldbus_introspection_parse(const char *xml)
31 Eldbus_Introspection_Node *node; 31 Eldbus_Introspection_Node *node;
32 Eina_Simple_XML_Node_Root *xml_root; 32 Eina_Simple_XML_Node_Root *xml_root;
33 Eina_Simple_XML_Node *xml_node; 33 Eina_Simple_XML_Node *xml_node;
34 Eina_Inlist *last = NULL;
34 35
35 EINA_SAFETY_ON_NULL_RETURN_VAL(xml, NULL); 36 EINA_SAFETY_ON_NULL_RETURN_VAL(xml, NULL);
36 37
37 node = NULL; 38 node = NULL;
38 xml_root = eina_simple_xml_node_load(xml, strlen(xml), EINA_TRUE); 39 xml_root = eina_simple_xml_node_load(xml, strlen(xml), EINA_TRUE);
39 xml_node = (Eina_Simple_XML_Node*)eina_inlist_last(xml_root->children); 40 if (xml_root && xml_root->children) last = xml_root->children->last;
41 xml_node = (Eina_Simple_XML_Node *)last;
40 EINA_SAFETY_ON_FALSE_GOTO(EINA_SIMPLE_XML_NODE_TAG == xml_node->type, free_root); 42 EINA_SAFETY_ON_FALSE_GOTO(EINA_SIMPLE_XML_NODE_TAG == xml_node->type, free_root);
41 43
42 node = (Eldbus_Introspection_Node*)_eldbus_introspection_parse_node((Eina_Simple_XML_Node_Tag*)xml_node); 44 node = (Eldbus_Introspection_Node*)_eldbus_introspection_parse_node((Eina_Simple_XML_Node_Tag*)xml_node);
diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c
index 08b91e5..00b231e 100644
--- a/src/lib/evas/filters/evas_filter_parser.c
+++ b/src/lib/evas/filters/evas_filter_parser.c
@@ -1394,6 +1394,7 @@ static Eina_Bool
1394_curve_instruction_prepare(Evas_Filter_Program *pgm, Evas_Filter_Instruction *instr) 1394_curve_instruction_prepare(Evas_Filter_Program *pgm, Evas_Filter_Instruction *instr)
1395{ 1395{
1396 Instruction_Param *param; 1396 Instruction_Param *param;
1397 Eina_Inlist *last = NULL;
1397 1398
1398 EINA_SAFETY_ON_NULL_RETURN_VAL(instr, EINA_FALSE); 1399 EINA_SAFETY_ON_NULL_RETURN_VAL(instr, EINA_FALSE);
1399 EINA_SAFETY_ON_NULL_RETURN_VAL(instr->name, EINA_FALSE); 1400 EINA_SAFETY_ON_NULL_RETURN_VAL(instr->name, EINA_FALSE);
@@ -1404,7 +1405,8 @@ _curve_instruction_prepare(Evas_Filter_Program *pgm, Evas_Filter_Instruction *in
1404 // TODO: Allow passing an array of 256 values as points. 1405 // TODO: Allow passing an array of 256 values as points.
1405 // It could be easily computed from another function in the script. 1406 // It could be easily computed from another function in the script.
1406 _instruction_param_seq_add(instr, "points", VT_SPECIAL, _lua_curve_points_func, NULL); 1407 _instruction_param_seq_add(instr, "points", VT_SPECIAL, _lua_curve_points_func, NULL);
1407 param = EINA_INLIST_CONTAINER_GET(eina_inlist_last(instr->params), Instruction_Param); 1408 if (instr->params) last = instr->params->last;
1409 param = EINA_INLIST_CONTAINER_GET(last, Instruction_Param);
1408 param->allow_any_string = EINA_TRUE; 1410 param->allow_any_string = EINA_TRUE;
1409 1411
1410 _instruction_param_seq_add(instr, "interpolation", VT_STRING, "linear"); 1412 _instruction_param_seq_add(instr, "interpolation", VT_STRING, "linear");