From 29fc3c6ee42b1c1bd2200c950393326007fa0d83 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 8 Nov 2010 15:30:55 +0100 Subject: [PATCH] ICU: refactor step creation --- src/icu_chain.c | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) 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; -- 1.7.10.4