Skip to content

Commit

Permalink
perf(ast): move_expression and move_statement produce dummy with …
Browse files Browse the repository at this point in the history
…no span
  • Loading branch information
overlookmotel committed Dec 18, 2024
1 parent 63a95e4 commit 3df6665
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/oxc_ast/src/ast_builder_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use std::{borrow::Cow, mem};

use oxc_allocator::{Allocator, Box, FromIn, String, Vec};
use oxc_span::{Atom, GetSpan, Span, SPAN};
use oxc_span::{Atom, Span, SPAN};
use oxc_syntax::{number::NumberBase, operator::UnaryOperator, scope::ScopeId};

use crate::{ast::*, AstBuilder};
Expand Down Expand Up @@ -115,14 +115,14 @@ impl<'a> AstBuilder<'a> {
/// Moves the expression out by replacing it with an [`Expression::NullLiteral`].
#[inline]
pub fn move_expression(self, expr: &mut Expression<'a>) -> Expression<'a> {
let null_expr = self.expression_null_literal(expr.span());
let null_expr = self.expression_null_literal(SPAN);
mem::replace(expr, null_expr)
}

/// Moves the statement out by replacing it with a [`Statement::EmptyStatement`].
#[inline]
pub fn move_statement(self, stmt: &mut Statement<'a>) -> Statement<'a> {
let empty_stmt = self.empty_statement(stmt.span());
let empty_stmt = self.empty_statement(SPAN);
mem::replace(stmt, Statement::EmptyStatement(self.alloc(empty_stmt)))
}

Expand Down

0 comments on commit 3df6665

Please sign in to comment.