HashList: Clear entire table on resizeAndClear

This commit is contained in:
Will Bainbridge
2024-01-04 10:16:21 +00:00
parent 57aa5ffc0a
commit ffc09d830b

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation \\ / A nd | Copyright (C) 2022-2024 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -65,11 +65,9 @@ void Foam::HashList<Type, Key, Hash>::clear()
template<class Type, class Key, class Hash> template<class Type, class Key, class Hash>
void Foam::HashList<Type, Key, Hash>::resizeAndClear(const label newSize) void Foam::HashList<Type, Key, Hash>::resizeAndClear(const label newSize)
{ {
List<Tuple2<Key, Type>>::resize List<Tuple2<Key, Type>>::resize(newSize);
(
newSize, clear();
Tuple2<Key, Type>(nullKey, Type())
);
} }