From: Adam Dickmeiss Date: Mon, 8 Nov 2010 14:30:55 +0000 (+0100) Subject: ICU: refactor step creation X-Git-Tag: v4.1.4~14^2~12^2~1 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=29fc3c6ee42b1c1bd2200c950393326007fa0d83;p=yaz-moved-to-github.git ICU: refactor step creation --- diff --git a/src/icu_chain.c b/src/icu_chain.c index e6044d4..d6521c0 100644 --- a/src/icu_chain.c +++ b/src/icu_chain.c @@ -71,8 +71,8 @@ int icu_check_status(UErrorCode status) return 1; } -static struct icu_chain_step *icu_chain_step_create( - struct icu_chain *chain, enum icu_chain_step_type type, +static struct icu_chain_step *icu_chain_insert_step( + struct icu_chain *chain, enum icu_chain_step_type type, const uint8_t *rule, UErrorCode *status) { struct icu_chain_step *step = 0; @@ -108,6 +108,9 @@ static struct icu_chain_step *icu_chain_step_create( default: break; } + step->previous = chain->csteps; + chain->csteps = step; + return step; } @@ -319,25 +322,6 @@ struct icu_chain *icu_chain_xml_config(const xmlNode *xml_node, return chain; } - -static struct icu_chain_step *icu_chain_insert_step( - struct icu_chain *chain, enum icu_chain_step_type type, - const uint8_t *rule, UErrorCode *status) -{ - struct icu_chain_step *step = 0; - if (!chain || !type || !rule) - return 0; - - /* create actual chain step with this buffer */ - step = icu_chain_step_create(chain, type, rule, - status); - - step->previous = chain->csteps; - chain->csteps = step; - - return step; -} - struct icu_iter { struct icu_chain *chain; struct icu_buf_utf16 *last;