From 217f905d8823500d8a9b47642bc0e12559447d7c Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Tue, 27 Dec 2005 15:22:06 +0100 Subject: [PATCH] call_dom_stack_callbacks(): Only acquire the state data if needed --- src/document/dom/stack.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/document/dom/stack.c b/src/document/dom/stack.c index 9ee21b45..95bb6510 100644 --- a/src/document/dom/stack.c +++ b/src/document/dom/stack.c @@ -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; } }