Skip to content

Commit

Permalink
Style: Rename var with more descriptive name
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Nov 16, 2024
1 parent 27e2343 commit 73e082f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/oxc_transformer/src/common/arrow_function_converter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@ impl<'a> ArrowFunctionConverter<'a> {
let arguments = self.create_arguments_var_declarator(target_scope_id, arguments_var, ctx);

let is_class_method_like = Self::is_class_method_like_ancestor(ctx.parent());
let capacity = usize::from(arguments.is_some())
let declarations_count = usize::from(arguments.is_some())
+ if is_class_method_like {
self.super_methods.as_ref().map_or(0, FxHashMap::len)
} else {
Expand All @@ -995,11 +995,11 @@ impl<'a> ArrowFunctionConverter<'a> {
+ usize::from(this_var.is_some());

// Exit if no declarations to be inserted
if capacity == 0 {
if declarations_count == 0 {
return;
}

let mut declarations = ctx.ast.vec_with_capacity(capacity);
let mut declarations = ctx.ast.vec_with_capacity(declarations_count);

if let Some(arguments) = arguments {
declarations.push(arguments);
Expand Down Expand Up @@ -1027,7 +1027,7 @@ impl<'a> ArrowFunctionConverter<'a> {
declarations.push(variable_declarator);
}

debug_assert_eq!(capacity, declarations.len());
debug_assert_eq!(declarations_count, declarations.len());

let stmt = ctx.ast.alloc_variable_declaration(
SPAN,
Expand Down

0 comments on commit 73e082f

Please sign in to comment.