diff options
author | 2023-08-06 22:49:10 -0700 | |
---|---|---|
committer | 2023-08-06 22:49:10 -0700 | |
commit | 00a907c7de842787e87b0d0a42d8d33704c5aaae (patch) | |
tree | d7b29475801dced2597f3f7406c0b9deaabe81b8 /src/bun.js/webcore/blob.zig | |
parent | 0665733b0302ac7e743e4c131c7697741fa923a5 (diff) | |
download | bun-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.zig | 3 |
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, }; } |