File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
frontend/include/chpl/uast Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -175,10 +175,14 @@ class Array final : public AstNode {
175175 rowIterStack.emplace_back (begin, end);
176176 }
177177
178+ static void assertNonEmptyArr (const Array* arr) {
179+ CHPL_ASSERT (arr->numExprs () > 0 && " empty arrays not supported" );
180+ }
181+
178182 public:
179183 // Construct an iterator starting at the beginning of the array
180184 static FlatteningArrayIterator normal (const Array* iterand) {
181- CHPL_ASSERT (iterand-> numExprs () > 0 && " empty arrays not supported " );
185+ assertNonEmptyArr (iterand);
182186 FlatteningArrayIterator ret (iterand->exprs ().begin (),
183187 iterand->exprs ().end ());
184188 ret.descendDims ();
@@ -187,7 +191,7 @@ class Array final : public AstNode {
187191
188192 // Construct an iterator starting at the end of the array
189193 static FlatteningArrayIterator end (const Array* iterand) {
190- CHPL_ASSERT (iterand-> numExprs () > 0 && " empty arrays not supported " );
194+ assertNonEmptyArr (iterand);
191195 return FlatteningArrayIterator (iterand->exprs ().end (),
192196 iterand->exprs ().end ());
193197 }
You can’t perform that action at this time.
0 commit comments