diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-07-12 08:20:45 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-07-12 08:20:45 (GMT) |
commit | 505c18d593b11fa682694a7653b17b325c1aac0e (patch) | |
tree | c3ba5e24ad98f73282a71b040e1a98de2b50b2d6 /generic/regexec.c | |
parent | 403569ef177348b14d7bfb85c2a488ecaf0a2117 (diff) | |
download | tcl-505c18d593b11fa682694a7653b17b325c1aac0e.zip tcl-505c18d593b11fa682694a7653b17b325c1aac0e.tar.gz tcl-505c18d593b11fa682694a7653b17b325c1aac0e.tar.bz2 |
Code cleanup (use {} in if/else statemenets)
Diffstat (limited to 'generic/regexec.c')
-rw-r--r-- | generic/regexec.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/generic/regexec.c b/generic/regexec.c index d0d5680..0ab3c88 100644 --- a/generic/regexec.c +++ b/generic/regexec.c @@ -237,10 +237,11 @@ exec( v->err = 0; assert(v->g->ntree >= 0); n = (size_t) v->g->ntree; - if (n <= LOCALDFAS) + if (n <= LOCALDFAS) { v->subdfas = subdfas; - else + } else { v->subdfas = (struct dfa **) MALLOC(n * sizeof(struct dfa *)); + } if (v->subdfas == NULL) { if (v->pmatch != pmatch && v->pmatch != mat) FREE(v->pmatch); @@ -641,10 +642,11 @@ cdissect( break; case '.': /* concatenation */ assert(t->left != NULL && t->right != NULL); - if (t->left->flags & SHORTER) /* reverse scan */ + if (t->left->flags & SHORTER) {/* reverse scan */ er = crevcondissect(v, t, begin, end); - else + } else { er = ccondissect(v, t, begin, end); + } break; case '|': /* alternation */ assert(t->left != NULL); @@ -652,10 +654,11 @@ cdissect( break; case '*': /* iteration */ assert(t->left != NULL); - if (t->left->flags & SHORTER) /* reverse scan */ + if (t->left->flags & SHORTER) {/* reverse scan */ er = creviterdissect(v, t, begin, end); - else + } else { er = citerdissect(v, t, begin, end); + } break; case '(': /* capturing */ assert(t->left != NULL && t->right == NULL); |