mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
AK: Remove unused and unintuitive Trait for char*
We don't use char* in containers, and the expectation would be a pointer compare instead of a string compare; so remove this specialisation entirely.
This commit is contained in:
parent
494fcc40ac
commit
553a7a9278
Notes:
github-actions[bot]
2025-10-21 16:22:06 +00:00
Author: https://github.com/alimpfard
Commit: 553a7a9278
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6531
Reviewed-by: https://github.com/gmta ✅
1 changed files with 0 additions and 9 deletions
|
|
@ -83,15 +83,6 @@ struct Traits<T> : public DefaultTraits<T> {
|
||||||
static constexpr bool is_trivially_serializable() { return Traits<UnderlyingType<T>>::is_trivially_serializable(); }
|
static constexpr bool is_trivially_serializable() { return Traits<UnderlyingType<T>>::is_trivially_serializable(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
requires(Detail::IsPointerOfType<char, T>) struct Traits<T> : public DefaultTraits<T> {
|
|
||||||
static unsigned hash(T const value) { return string_hash(value, strlen(value)); }
|
|
||||||
static constexpr bool equals(T const a, T const b) { return strcmp(a, b); }
|
|
||||||
static constexpr bool is_trivial() { return true; }
|
|
||||||
// NOTE: Trivial types always have fast equality checks.
|
|
||||||
static constexpr bool may_have_slow_equality_check() { return false; }
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if USING_AK_GLOBALLY
|
#if USING_AK_GLOBALLY
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue