Mercurial > hg > Members > masakoha > testcode
changeset 211:bc596e357a52
delete conditional branch in charClassMerge() (pattern 12)
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 28 Dec 2015 15:43:27 +0900 |
parents | e8aa8a1ea749 |
children | b0ae5273925c |
files | regexParser/subsetConstraction.cc |
diffstat | 1 files changed, 1 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/regexParser/subsetConstraction.cc Sun Dec 27 19:50:05 2015 +0900 +++ b/regexParser/subsetConstraction.cc Mon Dec 28 15:43:27 2015 +0900 @@ -88,21 +88,12 @@ return createCharClassRange(cc->cond.range.begin,cc->cond.range.end, cc->nextState.bitContainer | nextState.bitContainer,cc->left,cc1); } - if (begin > cc->cond.range.begin) { // 11 + if (begin > cc->cond.range.begin) { // 11,12 CharClassPtr cc1 = mergeCCTree(cc->right,cc->cond.range.end+1,end,nextState); CharClassPtr cc3 = createCharClassRange(cc->cond.range.begin,begin-1,cc->nextState.bitContainer,cc->left,NULL); return createCharClassRange(begin,cc->cond.range.end,cc->nextState.bitContainer | nextState.bitContainer,cc3,cc1); } } - // begin != end && end != cc->cond.range.end - if (begin == cc->cond.range.end) { // 12 - CharClassPtr cc1 = mergeCCTree(cc->right,begin+1,end,nextState); - if (cc->cond.range.begin == cc->cond.range.end) { - return createCharClassRange(cc->cond.range.begin,cc->cond.range.end,cc->nextState.bitContainer | nextState.bitContainer,cc1,cc->right); - } - CharClassPtr cc3 = createCharClassRange(cc->cond.range.begin,cc->cond.range.end-1,cc->nextState.bitContainer,cc->left,NULL); - return createCharClassRange(cc->cond.range.end,cc->cond.range.end,cc->nextState.bitContainer | nextState.bitContainer,cc1,cc3); - } } else if (begin < cc->cond.range.begin) { // 5 CharClassPtr cc1 = mergeCCTree(cc->left,begin,cc->cond.range.begin-1,nextState); CharClassPtr cc3 = mergeCCTree(cc->right,cc->cond.range.end+1,end,nextState);