Skip to content

Commit 150cb02

Browse files
committed
refactor(fe): delete redundant asserts
span::operator[] already bounds checks. Remove the extra bounds check in expression::children.
1 parent 67828c5 commit 150cb02

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/quick-lint-js/fe/expression.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,10 +1133,7 @@ inline int expression::child_count() const noexcept {
11331133
}
11341134

11351135
inline expression *expression::child(int index) const noexcept {
1136-
expression_arena::array_ptr<expression *> children = this->children();
1137-
QLJS_ASSERT(index >= 0);
1138-
QLJS_ASSERT(index < children.size());
1139-
return children[index];
1136+
return this->children()[index];
11401137
}
11411138

11421139
inline expression_arena::array_ptr<expression *> expression::children() const

0 commit comments

Comments
 (0)