mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 03:18:53 +00:00
* Fixes #9521 * Another test * Update load-file-loader-a-lot.test.ts * Update module_loader.zig * comments * Rename variable * Update module_loader.zig * Update exports.zig * small cleanup * bundows --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
This commit is contained in:
@@ -308,6 +308,16 @@ pub const String = extern struct {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn createIfDifferent(other: String, utf8_slice: []const u8) String {
|
||||
if (other.tag == .WTFStringImpl) {
|
||||
if (other.eqlUTF8(utf8_slice)) {
|
||||
return other.dupeRef();
|
||||
}
|
||||
}
|
||||
|
||||
return createUTF8(utf8_slice);
|
||||
}
|
||||
|
||||
fn createUninitializedLatin1(len: usize) struct { String, []u8 } {
|
||||
std.debug.assert(len > 0);
|
||||
const string = BunString__fromLatin1Unitialized(len);
|
||||
|
||||
Reference in New Issue
Block a user