optimize - avoid eina_inlist_last where not needed

really minor places.
This commit is contained in:
Carsten Haitzler 2019-06-15 09:31:51 +01:00
parent b5ed76ba9f
commit 297fa2bca0
2 changed files with 6 additions and 2 deletions

View File

@ -31,12 +31,14 @@ eldbus_introspection_parse(const char *xml)
Eldbus_Introspection_Node *node;
Eina_Simple_XML_Node_Root *xml_root;
Eina_Simple_XML_Node *xml_node;
Eina_Inlist *last = NULL;
EINA_SAFETY_ON_NULL_RETURN_VAL(xml, NULL);
node = NULL;
xml_root = eina_simple_xml_node_load(xml, strlen(xml), EINA_TRUE);
xml_node = (Eina_Simple_XML_Node*)eina_inlist_last(xml_root->children);
if (xml_root && xml_root->children) last = xml_root->children->last;
xml_node = (Eina_Simple_XML_Node *)last;
EINA_SAFETY_ON_FALSE_GOTO(EINA_SIMPLE_XML_NODE_TAG == xml_node->type, free_root);
node = (Eldbus_Introspection_Node*)_eldbus_introspection_parse_node((Eina_Simple_XML_Node_Tag*)xml_node);

View File

@ -1394,6 +1394,7 @@ static Eina_Bool
_curve_instruction_prepare(Evas_Filter_Program *pgm, Evas_Filter_Instruction *instr)
{
Instruction_Param *param;
Eina_Inlist *last = NULL;
EINA_SAFETY_ON_NULL_RETURN_VAL(instr, EINA_FALSE);
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
// TODO: Allow passing an array of 256 values as points.
// It could be easily computed from another function in the script.
_instruction_param_seq_add(instr, "points", VT_SPECIAL, _lua_curve_points_func, NULL);
param = EINA_INLIST_CONTAINER_GET(eina_inlist_last(instr->params), Instruction_Param);
if (instr->params) last = instr->params->last;
param = EINA_INLIST_CONTAINER_GET(last, Instruction_Param);
param->allow_any_string = EINA_TRUE;
_instruction_param_seq_add(instr, "interpolation", VT_STRING, "linear");