mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:37:34 +00:00
LibWeb: Implement CaseInsensitiveBytesTraits::equals()
Turns out HashTable::contains() doesn't solely use hash() for equality checks, so the lack of a proper equals() implementation broke the check in convert_header_names_to_a_sorted_lowercase_set() and caused duplicate entries in header_names_set.
This commit is contained in:
parent
6b64ca4bb8
commit
bad6ad8861
1 changed files with 6 additions and 1 deletions
|
@ -20,7 +20,12 @@ namespace Web::Fetch::Infrastructure {
|
|||
|
||||
template<typename T>
|
||||
requires(IsSameIgnoringCV<T, u8>) struct CaseInsensitiveBytesTraits : public Traits<Span<T>> {
|
||||
static unsigned hash(Span<T> const& span)
|
||||
static constexpr bool equals(Span<T> const& a, Span<T> const& b)
|
||||
{
|
||||
return StringView { a }.equals_ignoring_case(StringView { b });
|
||||
}
|
||||
|
||||
static constexpr unsigned hash(Span<T> const& span)
|
||||
{
|
||||
if (span.is_empty())
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue