diff options
author | 2021-08-27 18:15:29 -0700 | |
---|---|---|
committer | 2021-08-27 18:15:29 -0700 | |
commit | 0510d63ee59f334cd16d56a6df5406aee9d7b0e3 (patch) | |
tree | 075b77728e83c5e2f7261a3d8b684cc7729db9b2 /src | |
parent | 9a2ce8e1fa8ef8ddf1bd9a735b9e9b9d87586d91 (diff) | |
download | bun-0510d63ee59f334cd16d56a6df5406aee9d7b0e3.tar.gz bun-0510d63ee59f334cd16d56a6df5406aee9d7b0e3.tar.zst bun-0510d63ee59f334cd16d56a6df5406aee9d7b0e3.zip |
inline some things
Former-commit-id: aa13654739c00b669f0b0d864abff11a8386c2b5
Diffstat (limited to '')
-rw-r--r-- | src/js_ast.zig | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/js_ast.zig b/src/js_ast.zig index 52594aae0..be84afb08 100644 --- a/src/js_ast.zig +++ b/src/js_ast.zig @@ -726,12 +726,12 @@ pub const Symbol = struct { // "Ref" for more detail. symbols_for_source: [][]Symbol, - pub fn get(self: *Map, ref: Ref) ?Symbol { + pub fn get(self: *Map, ref: Ref) ?*Symbol { if (Ref.isSourceIndexNull(ref.source_index)) { return null; } - return self.symbols_for_source[ref.source_index][ref.inner_index]; + return &self.symbols_for_source[ref.source_index][ref.inner_index]; } pub fn init(sourceCount: usize, allocator: *std.mem.Allocator) !Map { @@ -744,7 +744,7 @@ pub const Symbol = struct { } pub fn follow(symbols: *Map, ref: Ref) Ref { - if (symbols.get(ref)) |*symbol| { + if (symbols.get(ref)) |symbol| { const link = symbol.link orelse return ref; if (!link.eql(ref)) { symbol.link = ref; @@ -757,23 +757,23 @@ pub const Symbol = struct { } }; - pub fn isKindPrivate(kind: Symbol.Kind) bool { + pub inline fn isKindPrivate(kind: Symbol.Kind) bool { return @enumToInt(kind) >= @enumToInt(Symbol.Kind.private_field) and @enumToInt(kind) <= @enumToInt(Symbol.Kind.private_static_get_set_pair); } - pub fn isKindHoisted(kind: Symbol.Kind) bool { + pub inline fn isKindHoisted(kind: Symbol.Kind) bool { return @enumToInt(kind) == @enumToInt(Symbol.Kind.hoisted) or @enumToInt(kind) == @enumToInt(Symbol.Kind.hoisted_function); } - pub fn isHoisted(self: *Symbol) bool { + pub inline fn isHoisted(self: *const Symbol) bool { return Symbol.isKindHoisted(self.kind); } - pub fn isKindHoistedOrFunction(kind: Symbol.Kind) bool { + pub inline fn isKindHoistedOrFunction(kind: Symbol.Kind) bool { return isKindHoisted(kind) or kind == Symbol.Kind.generator_or_async_function; } - pub fn isKindFunction(kind: Symbol.Kind) bool { + pub inline fn isKindFunction(kind: Symbol.Kind) bool { return kind == Symbol.Kind.hoisted_function or kind == Symbol.Kind.generator_or_async_function; } |