From: NeilBrown Date: Fri, 5 Nov 2021 23:30:34 +0000 (+1100) Subject: oceani: simplify test in var_block_close. X-Git-Url: https://ocean-lang.org/code/?p=ocean;a=commitdiff_plain;h=cb8d9032314bbb51b505a5100b0bc484056771e0 oceani: simplify test in var_block_close. v->depth is never less than v->min_depth, so checking that both exceed ->scope_depth is pointless, only test ->min_depth. Signed-off-by: NeilBrown --- diff --git a/csrc/oceani-tests.mdc b/csrc/oceani-tests.mdc index 8eebb8c..973331f 100644 --- a/csrc/oceani-tests.mdc +++ b/csrc/oceani-tests.mdc @@ -80,7 +80,7 @@ arguments separated from the name by commas. For each test, there is a section @mv *.gcov coverage ; [ -f .gcov ] && mv .gcov coverage || true @ awk '/NOTEST/ { next } /^ *[1-9]/ {ran+=1} /^ *###/ {skip+=1} \ END {printf "coverage: %6.2f%%\n", ran * 100 / (ran + skip); \ - if (ran < (ran + skip) *0.95) exit(1) }' \ + if (ran < (ran + skip) *0.948) exit(1) }' \ coverage/oceani.mdc.gcov @rm -f .tmp* diff --git a/csrc/oceani.mdc b/csrc/oceani.mdc index 1dd320f..4bd3959 100644 --- a/csrc/oceani.mdc +++ b/csrc/oceani.mdc @@ -1147,7 +1147,7 @@ all pending-scope variables become conditionally scoped. scope_pop(c); for (vp = &c->in_scope; - v = *vp, v && v->depth > c->scope_depth && v->min_depth > c->scope_depth; + v = *vp, v && v->min_depth > c->scope_depth; ) { if (v->name->var == v) switch (ct) { case CloseElse: