mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 11:29:02 +00:00
node:http improvements (#17093)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: Pham Minh Triet <92496972+Nanome203@users.noreply.github.com> Co-authored-by: snwy <snwy@snwy.me> Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com> Co-authored-by: cirospaciari <cirospaciari@users.noreply.github.com> Co-authored-by: Ben Grant <ben@bun.sh>
This commit is contained in:
@@ -268,6 +268,10 @@ pub const String = extern struct {
|
||||
/// They're de-duplicated in a threadlocal hash table
|
||||
/// They cannot be used from other threads.
|
||||
pub fn createAtomIfPossible(bytes: []const u8) String {
|
||||
if (bytes.len == 0) {
|
||||
return String.empty;
|
||||
}
|
||||
|
||||
if (bytes.len < 64) {
|
||||
if (tryCreateAtom(bytes)) |atom| {
|
||||
return atom;
|
||||
|
||||
Reference in New Issue
Block a user