Commit 3bc45fbf authored by Max Kellermann's avatar Max Kellermann

util/AllocatedString: remove Null(), IsNull()

parent 36168a24
......@@ -29,7 +29,7 @@
NarrowPath::NarrowPath(Path _path) noexcept
:value(WideCharToMultiByte(CP_ACP, _path.c_str()))
{
if (value.IsNull())
if (value == nullptr)
/* fall back to empty string */
value = Value::Empty();
}
......
......@@ -56,7 +56,7 @@ IcuCompare::operator==(const char *haystack) const noexcept
#ifdef HAVE_ICU_CASE_FOLD
return StringIsEqual(IcuCaseFold(haystack).c_str(), needle.c_str());
#elif defined(_WIN32)
if (needle.IsNull())
if (needle == nullptr)
/* the MultiByteToWideChar() call in the constructor
has failed, so let's always fail the comparison */
return false;
......@@ -83,7 +83,7 @@ IcuCompare::IsIn(const char *haystack) const noexcept
return StringFind(IcuCaseFold(haystack).c_str(),
needle.c_str()) != nullptr;
#elif defined(_WIN32)
if (needle.IsNull())
if (needle == nullptr)
/* the MultiByteToWideChar() call in the constructor
has failed, so let's always fail the comparison */
return false;
......
......@@ -65,7 +65,7 @@ public:
gcc_pure
operator bool() const noexcept {
return !needle.IsNull();
return needle != nullptr;
}
gcc_pure
......
......@@ -110,7 +110,7 @@ icy_server_metadata_page(const Tag &tag, const TagType *types) noexcept
const auto icy_string = icy_server_metadata_string(stream_title, "");
if (icy_string.IsNull())
if (icy_string == nullptr)
return nullptr;
return std::make_shared<Page>(icy_string.c_str(),
......
......@@ -85,10 +85,6 @@ public:
return BasicAllocatedString(value);
}
static BasicAllocatedString Null() noexcept {
return nullptr;
}
static BasicAllocatedString Empty() {
auto p = new value_type[1];
p[0] = SENTINEL;
......@@ -120,10 +116,6 @@ public:
return value != nullptr;
}
constexpr bool IsNull() const noexcept {
return value == nullptr;
}
operator string_view() const noexcept {
return value != nullptr
? string_view(value)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment