DEFEATURE: remove old/unused SLList -> List construct/assignment

- should ideally avoid SLList in most cases, since it is allocation
  intensive and most places can easily use DynamicList or
  CircularBuffer instead.

STYLE: use push_uniq instead of deprecated appendUniq method

- mark with a 'normal' deprecation instead of 'strict' deprecation
This commit is contained in:
Mark Olesen 2025-03-06 14:24:02 +01:00
parent ae638c2b9c
commit f13be4f62c
5 changed files with 5 additions and 44 deletions

View File

@ -447,7 +447,7 @@ public:
}
//- Same as push_uniq()
FOAM_DEPRECATED_STRICT(2022-10, "push_uniq()")
FOAM_DEPRECATED_FOR(2022-10, "push_uniq()")
label appendUniq(const T& val) { return this->push_uniq(val); }
};

View File

@ -486,35 +486,4 @@ void Foam::sortedOrder
}
// * * * * * * * * * * * * * * * Housekeeping * * * * * * * * * * * * * * * //
#include "SLList.H"
template<class T>
Foam::List<T>::List(const SLList<T>& list)
:
List<T>(list.begin(), list.end(), list.size())
{}
template<class T>
void Foam::List<T>::operator=(const SLList<T>& list)
{
const label len = list.size();
reAlloc(len);
// Cannot use std::copy algorithm
// - SLList doesn't define iterator category
T* iter = this->begin();
for (const T& val : list)
{
*iter = val;
++iter;
}
}
// ************************************************************************* //

View File

@ -45,7 +45,6 @@ SourceFiles
#include "autoPtr.H"
#include "UList.H"
#include "SLListFwd.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -404,15 +403,8 @@ public:
}
//- Same as push_uniq()
FOAM_DEPRECATED_STRICT(2022-10, "push_uniq()")
FOAM_DEPRECATED_FOR(2022-10, "push_uniq()")
label appendUniq(const T& val) { return this->push_uniq(val); }
//- Copy construct from SLList
explicit List(const SLList<T>& list);
//- Copy assign from SLList in linear time
void operator=(const SLList<T>& list);
};

View File

@ -193,7 +193,7 @@ public:
void push_back(const word& val) { this->push_uniq(val); }
//- Same as push_uniq()
FOAM_DEPRECATED_STRICT(2022-10, "push_uniq method")
FOAM_DEPRECATED_FOR(2022-10, "push_uniq method")
label appendUniq(const word& val) { return this->push_uniq(val); }
};

View File

@ -2670,8 +2670,8 @@ void Foam::snappySnapDriver::doSnap
surfaceZonesInfo::faceZoneType type;
if (meshRefiner_.getFaceZoneInfo(fz.name(), mpI, spI, type))
{
bufPatchIDs.appendUniq(mpI);
bufPatchIDs.appendUniq(spI);
bufPatchIDs.push_uniq(mpI);
bufPatchIDs.push_uniq(spI);
}
}
}