QHash: fix constness for heterogenous lookup functions

Pick-to: 6.8
Change-Id: I161237fc243ebcf48e1318dae045f2e812796786
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
Fabian Kosmale 2024-08-21 20:11:40 +02:00
parent 31d3e57342
commit 205edd1507

View File

@ -1395,11 +1395,11 @@ public:
{
return takeImpl(key);
}
bool contains(const QHashPrivate::HeterogeneouslySearchableWith<Key> auto &key)
bool contains(const QHashPrivate::HeterogeneouslySearchableWith<Key> auto &key) const
{
return d ? d->findNode(key) != nullptr : false;
}
qsizetype count(const QHashPrivate::HeterogeneouslySearchableWith<Key> auto &key)
qsizetype count(const QHashPrivate::HeterogeneouslySearchableWith<Key> auto &key) const
{
return contains(key) ? 1 : 0;
}