1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

call_dom_stack_callbacks(): Only acquire the state data if needed

This commit is contained in:
Jonas Fonseca 2005-12-27 15:22:06 +01:00 committed by Jonas Fonseca
parent a31eaaabdd
commit 217f905d88

View File

@ -137,7 +137,6 @@ call_dom_stack_callbacks(struct dom_stack *stack, struct dom_stack_state *state,
for (i = 0; i < stack->contexts_size; i++) {
struct dom_stack_context *context = stack->contexts[i];
void *state_data = get_dom_stack_state_data(context, state);
dom_stack_callback_T callback;
if (action == DOM_STACK_PUSH)
@ -146,8 +145,10 @@ call_dom_stack_callbacks(struct dom_stack *stack, struct dom_stack_state *state,
callback = context->info->pop[state->node->type];
if (callback) {
void *data = get_dom_stack_state_data(context, state);
stack->current = context;
callback(stack, state->node, state_data);
callback(stack, state->node, data);
stack->current = NULL;
}
}