mirror of
https://github.com/oxc-project/oxc.git
synced 2026-11-04 10:29:58 +00:00
perf(semantic): reduce AstNodeId to u32 (#4264)
`AstNodeId` was a `usize`. This seems excessive. Parser has a limit on size of a JS file of 4 GiB. While it is *possible* for a JS file of that size to create an AST with more than `1 << 32` (~4 billion) AST nodes, that would be insanely large. So make `AstNodeId` `u32` instead.
This commit is contained in:
1 parent
23743dbd59
commit
8fad7dbac3
1 file changed
+1
-1
@@ -2,7 +2,7 @@ use bitflags::bitflags;
|
||||
use oxc_index::define_index_type;
|
||||
|
||||
define_index_type! {
|
||||
pub struct AstNodeId = usize;
|
||||
pub struct AstNodeId = u32;
|
||||
}
|
||||
|
||||
impl AstNodeId {
|
||||
|
||||
Reference in new issue
Block a user