QHash: Fix typo for heterogeneous lookup feature

searchable was missing an 'r'.

Change-Id: I9532fa4d849c48a16495fe1cbd924ab781d6366d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7a6ecc3e5d4d55709508d6c93414b4af57575a4c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Mårten Nordheim 2024-10-13 22:33:13 +02:00 committed by Qt Cherry-pick Bot
parent f3bcce4d2d
commit 55ad2c33b1
2 changed files with 37 additions and 37 deletions

View File

@ -1378,33 +1378,33 @@ private:
}
template <typename K>
using if_heterogeneously_seachable = QHashPrivate::if_heterogeneously_seachable_with<Key, K>;
using if_heterogeneously_searchable = QHashPrivate::if_heterogeneously_searchable_with<Key, K>;
template <typename K>
using if_key_constructible_from = std::enable_if_t<std::is_constructible_v<Key, K>, bool>;
public:
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
bool remove(const K &key)
{
return removeImpl(key);
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
T take(const K &key)
{
return takeImpl(key);
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
bool contains(const K &key) const
{
return d ? d->findNode(key) != nullptr : false;
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
qsizetype count(const K &key) const
{
return contains(key) ? 1 : 0;
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
T value(const K &key) const noexcept
{
if (auto *v = valueImpl(key))
@ -1412,7 +1412,7 @@ public:
else
return T();
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
T value(const K &key, const T &defaultValue) const noexcept
{
if (auto *v = valueImpl(key))
@ -1420,39 +1420,39 @@ public:
else
return defaultValue;
}
template <typename K, if_heterogeneously_seachable<K> = true, if_key_constructible_from<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true, if_key_constructible_from<K> = true>
T &operator[](const K &key)
{
return operatorIndexImpl(key);
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
const T operator[](const K &key) const noexcept
{
return value(key);
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
std::pair<iterator, iterator>
equal_range(const K &key)
{
return equal_range_impl(*this, key);
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
std::pair<const_iterator, const_iterator>
equal_range(const K &key) const noexcept
{
return equal_range_impl(*this, key);
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
iterator find(const K &key)
{
return findImpl(key);
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
const_iterator find(const K &key) const noexcept
{
return constFindImpl(key);
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
const_iterator constFind(const K &key) const noexcept
{
return find(key);
@ -2390,30 +2390,30 @@ private:
}
template <typename K>
using if_heterogeneously_seachable = QHashPrivate::if_heterogeneously_seachable_with<Key, K>;
using if_heterogeneously_searchable = QHashPrivate::if_heterogeneously_searchable_with<Key, K>;
template <typename K>
using if_key_constructible_from = std::enable_if_t<std::is_constructible_v<Key, K>, bool>;
public:
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
qsizetype remove(const K &key)
{
return removeImpl(key);
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
T take(const K &key)
{
return takeImpl(key);
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
bool contains(const K &key) const noexcept
{
if (!d)
return false;
return d->findNode(key) != nullptr;
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
T value(const K &key) const noexcept
{
if (auto *v = valueImpl(key))
@ -2421,7 +2421,7 @@ public:
else
return T();
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
T value(const K &key, const T &defaultValue) const noexcept
{
if (auto *v = valueImpl(key))
@ -2429,78 +2429,78 @@ public:
else
return defaultValue;
}
template <typename K, if_heterogeneously_seachable<K> = true, if_key_constructible_from<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true, if_key_constructible_from<K> = true>
T &operator[](const K &key)
{
return operatorIndexImpl(key);
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
const T operator[](const K &key) const noexcept
{
return value(key);
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
QList<T> values(const K &key)
{
return valuesImpl(key);
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
iterator find(const K &key)
{
return findImpl(key);
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
const_iterator constFind(const K &key) const noexcept
{
return constFindImpl(key);
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
const_iterator find(const K &key) const noexcept
{
return constFindImpl(key);
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
bool contains(const K &key, const T &value) const noexcept
{
return containsImpl(key, value);
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
qsizetype remove(const K &key, const T &value)
{
return removeImpl(key, value);
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
qsizetype count(const K &key) const noexcept
{
return countImpl(key);
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
qsizetype count(const K &key, const T &value) const noexcept
{
return countImpl(key, value);
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
iterator find(const K &key, const T &value)
{
return findImpl(key, value);
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
const_iterator constFind(const K &key, const T &value) const noexcept
{
return constFindImpl(key, value);
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
const_iterator find(const K &key, const T &value) const noexcept
{
return constFind(key, value);
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
std::pair<iterator, iterator>
equal_range(const K &key)
{
return equal_range_impl(key);
}
template <typename K, if_heterogeneously_seachable<K> = true>
template <typename K, if_heterogeneously_searchable<K> = true>
std::pair<const_iterator, const_iterator>
equal_range(const K &key) const noexcept
{

View File

@ -269,7 +269,7 @@ using HeterogeneouslySearchableWith = HeterogeneouslySearchableWithHelper<
>;
template <typename Key, typename K>
using if_heterogeneously_seachable_with = std::enable_if_t<
using if_heterogeneously_searchable_with = std::enable_if_t<
QHashPrivate::HeterogeneouslySearchableWith<Key, K>::value,
bool>;
@ -281,7 +281,7 @@ bool qHashEquals(const T &a, const T &b)
return a == b;
}
template <typename T1, typename T2, QHashPrivate::if_heterogeneously_seachable_with<T1, T2> = true>
template <typename T1, typename T2, QHashPrivate::if_heterogeneously_searchable_with<T1, T2> = true>
bool qHashEquals(const T1 &a, const T2 &b)
{
return a == b;