mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add ListOps find/found accepting a unary predicate (#1182)
- can also be used for other purposes.
Eg,
if (ListOps::found(list, matcher))
{
...
}
vs.
if (!findStrings(matcher, list).empty())
{
...
}
This commit is contained in:
@ -26,8 +26,8 @@ License
|
||||
#include "sampledSets.H"
|
||||
#include "volFields.H"
|
||||
#include "IOobjectList.H"
|
||||
#include "stringListOps.H"
|
||||
#include "UIndirectList.H"
|
||||
#include "ListOps.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
@ -69,7 +69,7 @@ Foam::label Foam::sampledSets::classifyFields()
|
||||
// Detect missing fields
|
||||
forAll(fieldSelection_, i)
|
||||
{
|
||||
if (findStrings(fieldSelection_[i], allFields).empty())
|
||||
if (!ListOps::found(allFields, fieldSelection_[i]))
|
||||
{
|
||||
missed.append(i);
|
||||
}
|
||||
|
||||
@ -25,8 +25,8 @@ License
|
||||
|
||||
#include "sampledSurfaces.H"
|
||||
#include "IOobjectList.H"
|
||||
#include "stringListOps.H"
|
||||
#include "UIndirectList.H"
|
||||
#include "ListOps.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
@ -57,7 +57,7 @@ Foam::label Foam::sampledSurfaces::classifyFields()
|
||||
// Detect missing fields
|
||||
forAll(fieldSelection_, i)
|
||||
{
|
||||
if (findStrings(fieldSelection_[i], allFields).empty())
|
||||
if (!ListOps::found(allFields, fieldSelection_[i]))
|
||||
{
|
||||
missed.append(i);
|
||||
}
|
||||
|
||||
@ -641,7 +641,7 @@ void Foam::isoSurfaceTopo::generateTriPoints
|
||||
forAll(f1, fp)
|
||||
{
|
||||
oppositeI = f1[fp];
|
||||
if (findIndex(f0, oppositeI) == -1)
|
||||
if (!f0.found(oppositeI))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user