From 00a907c7de842787e87b0d0a42d8d33704c5aaae Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Sun, 6 Aug 2023 22:49:10 -0700 Subject: Fixes #4001 (#4034) * Avoid a utf8 conversion in isDetached * Fixes #4001 * hit the long url codepath --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> --- src/bun.js/webcore/blob.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/bun.js/webcore/blob.zig') diff --git a/src/bun.js/webcore/blob.zig b/src/bun.js/webcore/blob.zig index 7036babfb..b384048ce 100644 --- a/src/bun.js/webcore/blob.zig +++ b/src/bun.js/webcore/blob.zig @@ -3943,7 +3943,8 @@ pub const AnyBlob = union(enum) { pub fn isDetached(this: *const AnyBlob) bool { return switch (this.*) { .Blob => |blob| blob.isDetached(), - else => this.slice().len == 0, + .InternalBlob => this.InternalBlob.bytes.items.len == 0, + .WTFStringImpl => this.WTFStringImpl.length() == 0, }; } -- cgit v1.2.3