From b1684e3588d95b93f3268895c5a0a7c156cd018e Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 19 Aug 2015 18:20:30 +0100 Subject: Slight simplification of set_initial group checks. --- src/select/select.c | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/select/select.c b/src/select/select.c index 92696ff..17dff31 100644 --- a/src/select/select.c +++ b/src/select/select.c @@ -1173,26 +1173,25 @@ css_error set_initial(css_select_state *state, * accessors to return the initial values for the * property. */ - if (group == GROUP_NORMAL) { - error = prop_dispatch[prop].initial(state); - if (error != CSS_OK) - return error; - } else if (group == GROUP_UNCOMMON && - state->computed->uncommon != NULL) { - error = prop_dispatch[prop].initial(state); - if (error != CSS_OK) - return error; - } else if (group == GROUP_PAGE && - state->computed->page != NULL) { - error = prop_dispatch[prop].initial(state); - if (error != CSS_OK) - return error; - } else if (group == GROUP_AURAL && - state->computed->aural != NULL) { - error = prop_dispatch[prop].initial(state); - if (error != CSS_OK) - return error; + switch (group) { + case GROUP_NORMAL: + break; + case GROUP_UNCOMMON: + if (state->computed->uncommon == NULL) + return CSS_OK; + break; + case GROUP_PAGE: + if (state->computed->page == NULL) + return CSS_OK; + break; + case GROUP_AURAL: + if (state->computed->aural == NULL) + return CSS_OK; + break; } + error = prop_dispatch[prop].initial(state); + if (error != CSS_OK) + return error; } return CSS_OK; -- cgit v1.2.3