mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -447,7 +447,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Same as push_uniq()
|
//- 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); }
|
label appendUniq(const T& val) { return this->push_uniq(val); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -45,7 +45,6 @@ SourceFiles
|
|||||||
|
|
||||||
#include "autoPtr.H"
|
#include "autoPtr.H"
|
||||||
#include "UList.H"
|
#include "UList.H"
|
||||||
#include "SLListFwd.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -404,15 +403,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Same as push_uniq()
|
//- 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); }
|
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);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -193,7 +193,7 @@ public:
|
|||||||
void push_back(const word& val) { this->push_uniq(val); }
|
void push_back(const word& val) { this->push_uniq(val); }
|
||||||
|
|
||||||
//- Same as push_uniq()
|
//- 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); }
|
label appendUniq(const word& val) { return this->push_uniq(val); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -2670,8 +2670,8 @@ void Foam::snappySnapDriver::doSnap
|
|||||||
surfaceZonesInfo::faceZoneType type;
|
surfaceZonesInfo::faceZoneType type;
|
||||||
if (meshRefiner_.getFaceZoneInfo(fz.name(), mpI, spI, type))
|
if (meshRefiner_.getFaceZoneInfo(fz.name(), mpI, spI, type))
|
||||||
{
|
{
|
||||||
bufPatchIDs.appendUniq(mpI);
|
bufPatchIDs.push_uniq(mpI);
|
||||||
bufPatchIDs.appendUniq(spI);
|
bufPatchIDs.push_uniq(spI);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user