micro-optimize loading process environment variables

This commit is contained in:
Jarred Sumner
2023-01-18 00:28:19 -08:00
parent 0759530118
commit 2016e8a0af

View File

@@ -676,8 +676,10 @@ pub const Loader = struct {
// This is a little weird because it's evidently stored line-by-line
var source = logger.Source.initPathString("process.env", "");
this.map.map.ensureTotalCapacity(std.os.environ.len) catch unreachable;
for (std.os.environ) |env| {
source.contents = std.mem.span(env);
source.contents = bun.span(env);
Parser.parse(&source, this.allocator, this.map, true, true);
}
this.did_load_process = true;