aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/webcore/blob.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2023-08-06 22:49:10 -0700
committerGravatar GitHub <noreply@github.com> 2023-08-06 22:49:10 -0700
commit00a907c7de842787e87b0d0a42d8d33704c5aaae (patch)
treed7b29475801dced2597f3f7406c0b9deaabe81b8 /src/bun.js/webcore/blob.zig
parent0665733b0302ac7e743e4c131c7697741fa923a5 (diff)
downloadbun-00a907c7de842787e87b0d0a42d8d33704c5aaae.tar.gz
bun-00a907c7de842787e87b0d0a42d8d33704c5aaae.tar.zst
bun-00a907c7de842787e87b0d0a42d8d33704c5aaae.zip
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>
Diffstat (limited to 'src/bun.js/webcore/blob.zig')
-rw-r--r--src/bun.js/webcore/blob.zig3
1 files changed, 2 insertions, 1 deletions
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,
};
}