Skip to content

Commit 4817e49

Browse files
committed
Fix rule
1 parent 1e551fb commit 4817e49

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/index_notation/transformations.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -624,18 +624,15 @@ IndexStmt Precompute::apply(IndexStmt stmt, std::string* reason) const {
624624
if (is_equal && has_sibling) {
625625
to_change.push_back(a);
626626
}
627-
if (is_none && has_sibling && ctx_num > 1) {
628-
to_change.push_back(a);
629-
}
630-
631-
bool has_outside = false;
627+
bool has_outside = true;
632628
for (auto & var : seen) {
633-
if (var!=ctx_stack.back()){
634-
has_outside = true;
635-
break;
629+
for (auto &svar: ctx_stack) {
630+
if (svar != ctx_stack.back() && var != svar) {
631+
has_outside = false;
632+
}
636633
}
637634
}
638-
if (is_none && has_sibling && ctx_num == 1 && has_outside) {
635+
if (is_none && has_outside) {
639636
to_change.push_back(a);
640637
}
641638
}

0 commit comments

Comments
 (0)