mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: HashTable/HashSet contains(key) method
- functionality provided as 'found(key)' in OpenFOAM naming, since there was no stl equivalent at the time. Now support contains(), which is the equivalent for C++20 maps/sets. STYLE: general contains() method for containers STYLE: treat Enum and Switch similarly as hash-like objects
This commit is contained in:
@ -553,7 +553,7 @@ Foam::label Foam::HashTable<T, Key, Hash>::erase
|
||||
++iter
|
||||
)
|
||||
{
|
||||
if (other.found(iter.key()) && erase(iter))
|
||||
if (other.contains(iter.key()) && erase(iter))
|
||||
{
|
||||
++changed;
|
||||
}
|
||||
@ -586,7 +586,7 @@ Foam::label Foam::HashTable<T, Key, Hash>::retain
|
||||
|
||||
for (iterator iter = begin(); iter != end(); ++iter)
|
||||
{
|
||||
if (!other.found(iter.key()) && erase(iter))
|
||||
if (!other.contains(iter.key()) && erase(iter))
|
||||
{
|
||||
++changed;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user