util/StringCompare: simplify StringIsEqual() using operator==
This commit is contained in:
parent
1930ed16cb
commit
52e2130d51
|
@ -22,8 +22,7 @@ StringIsEmpty(const char *string) noexcept
|
||||||
static inline bool
|
static inline bool
|
||||||
StringIsEqual(std::string_view a, std::string_view b) noexcept
|
StringIsEqual(std::string_view a, std::string_view b) noexcept
|
||||||
{
|
{
|
||||||
return a.size() == b.size() &&
|
return a == b;
|
||||||
StringIsEqual(a.data(), b.data(), b.size());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[[gnu::pure]]
|
[[gnu::pure]]
|
||||||
|
|
|
@ -21,8 +21,7 @@ StringIsEmpty(const wchar_t *string) noexcept
|
||||||
static inline bool
|
static inline bool
|
||||||
StringIsEqual(std::wstring_view a, std::wstring_view b) noexcept
|
StringIsEqual(std::wstring_view a, std::wstring_view b) noexcept
|
||||||
{
|
{
|
||||||
return a.size() == b.size() &&
|
return a == b;
|
||||||
StringIsEqual(a.data(), b.data(), b.size());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[[gnu::pure]]
|
[[gnu::pure]]
|
||||||
|
|
Loading…
Reference in New Issue