aboutsummaryrefslogtreecommitdiff
path: root/src/http.zig
diff options
context:
space:
mode:
authorGravatar Dylan Conway <35280289+dylan-conway@users.noreply.github.com> 2023-04-20 05:23:12 -0700
committerGravatar GitHub <noreply@github.com> 2023-04-20 05:23:12 -0700
commitd78ecc76c854310fd47da32071d22301b0782ec3 (patch)
treedcee5bde1b3598203de25f07a632cfb55aaa01e5 /src/http.zig
parent9e7bfdec8cd4fc1827a5d793844afe36638ded37 (diff)
downloadbun-d78ecc76c854310fd47da32071d22301b0782ec3.tar.gz
bun-d78ecc76c854310fd47da32071d22301b0782ec3.tar.zst
bun-d78ecc76c854310fd47da32071d22301b0782ec3.zip
Symbol minification (#2695)
* minify * Update renamer.zig * --minify-whitespace * Speed up minification a little * handle private names * 5% faster minification * use helper function * fix nested scope slots * `bun build --minify` gets another +8% faster * print semicolons afterwards * print semicolon after checking error * after all error checking * Delete code for generating legacy bundes * remove extra whitespace around if statements * print space before import identifier * Use `@constCast` * Make `S.Local#decls` use `BabyList(Decl)` * Add `fromSlice` helper to `BabyList` * Remove unnecessary optional chains * minify `undefined, true, false` * Another @constCast * Implement merge adjacent local var * Support --minify in `bun build --transform` * skip comments when counting character frequencies * Don't wrap commonjs with --transform on (unless targeting bun) * Support --minify in the runtime * Fix edgecase with import * as * don't infinite loop * --trnasform shouldn't mess with require * Only track comments when minifying --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/http.zig')
-rw-r--r--src/http.zig4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/http.zig b/src/http.zig
index a030aed80..08ecbda92 100644
--- a/src/http.zig
+++ b/src/http.zig
@@ -44,9 +44,7 @@ const ObjectPool = @import("./pool.zig").ObjectPool;
const Lock = @import("./lock.zig").Lock;
const RequestDataPool = ObjectPool([32_000]u8, null, false, 1);
const ResolveWatcher = @import("./resolver/resolver.zig").ResolveWatcher;
-pub fn constStrToU8(s: string) []u8 {
- return @intToPtr([*]u8, @ptrToInt(s.ptr))[0..s.len];
-}
+const constStrToU8 = bun.constStrToU8;
pub const MutableStringAPIWriter = NewApiWriter(*MutableString);