mirror of
https://github.com/aphrody-labs/oxc.git
synced 2026-10-15 06:39:17 +00:00
perf(semantic): avoid allocation in class overload check (#25440)
This commit is contained in:
1 parent
a92c5410a1
commit
dd1430baed
1 file changed
+2
-1
@@ -218,7 +218,8 @@ pub fn check_class<'a>(class: &Class<'a>, ctx: &SemanticBuilder<'a>) {
|
||||
|
||||
if !ctx.in_ambient_context() {
|
||||
let mut is_in_overload_group = false;
|
||||
for (a, b) in class.body.body.iter().map(Some).chain(vec![None]).tuple_windows() {
|
||||
for (a, b) in class.body.body.iter().map(Some).chain(std::iter::once(None)).tuple_windows()
|
||||
{
|
||||
if let Some(ClassElement::MethodDefinition(a)) = a
|
||||
&& !a.r#type.is_abstract()
|
||||
&& !a.optional
|
||||
|
||||
Reference in new issue
Block a user