Delete unnecessary overloads

This commit is contained in:
Ben Grant
2025-03-25 16:53:45 -07:00
parent a7bb4d7cb1
commit b3bfede930
2 changed files with 0 additions and 17 deletions

View File

@@ -224,13 +224,6 @@ BunString toStringRef(JSC::JSGlobalObject* globalObject, JSValue value)
return { BunStringTag::WTFStringImpl, { .wtf = impl } };
}
BunString toStringNonRef(WTF::String& wtfString)
{
if (wtfString.isEmpty())
return { BunStringTag::Empty };
return { BunStringTag::WTFStringImpl, { .wtf = wtfString.impl() } };
}
BunString toStringNonRef(const WTF::String& wtfString)
{
if (wtfString.isEmpty())
@@ -246,14 +239,6 @@ BunString toStringNonRef(WTF::StringImpl* wtfString)
return { BunStringTag::WTFStringImpl, { .wtf = wtfString } };
}
BunString toStringRef(WTF::String& wtfString)
{
if (wtfString.isEmpty())
return { BunStringTag::Empty };
wtfString.impl()->ref();
return { BunStringTag::WTFStringImpl, { .wtf = wtfString.impl() } };
}
BunString toStringRef(const WTF::String& wtfString)
{
if (wtfString.isEmpty())

View File

@@ -299,14 +299,12 @@ BunString toString(const char* bytes, size_t length);
// the same lifetime as the argument. Be very careful that the BunString is not used after the
// WTF::String has gone out of scope.
BunString toStringNonRef(JSC::JSGlobalObject* globalObject, JSC::JSValue value);
BunString toStringNonRef(WTF::String& wtfString);
BunString toStringNonRef(const WTF::String& wtfString);
BunString toStringNonRef(WTF::StringImpl* wtfString);
// These functions increment the reference count on their argument. `deref` must be called later
// on the return value to avoid a leak.
BunString toStringRef(JSC::JSGlobalObject* globalObject, JSC::JSValue value);
BunString toStringRef(WTF::String& wtfString);
BunString toStringRef(const WTF::String& wtfString);
BunString toStringRef(WTF::StringImpl* wtfString);