From 06f08f74e1b3cff9436ef81c4e32a170e365a018 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 11 Nov 2019 18:50:00 +0100 Subject: [PATCH] ENH: rationalize some string methods. - silently deprecate 'startsWith', 'endsWith' methods (added in 2016: 2b1436066221), in favour of 'starts_with', 'ends_with' methods, corresponding to C++20 and allowing us to cull then in a few years. - handle single character versions of starts_with, ends_with. - add single character version of removeEnd and silently deprecate removeTrailing which did the same thing. - drop the const versions of removeRepeated, removeTrailing. Unused and with potential confusion. STYLE: use shrink_to_fit(), erase() --- src/paraview-plugins/foamReader/library/vtkPVFoam.C | 2 +- src/paraview-plugins/foamReader/library/vtkPVFoamMesh.C | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/paraview-plugins/foamReader/library/vtkPVFoam.C b/src/paraview-plugins/foamReader/library/vtkPVFoam.C index c5c648c..8db72b8 100644 --- a/src/paraview-plugins/foamReader/library/vtkPVFoam.C +++ b/src/paraview-plugins/foamReader/library/vtkPVFoam.C @@ -678,7 +678,7 @@ void Foam::vtkPVFoam::Update // Suppress caching of Lagrangian since it normally always changes. cachedVtp_.filterKeys ( - [](const word& k){ return k.startsWith("lagrangian/"); }, + [](const word& k){ return k.starts_with("lagrangian/"); }, true // prune ); } diff --git a/src/paraview-plugins/foamReader/library/vtkPVFoamMesh.C b/src/paraview-plugins/foamReader/library/vtkPVFoamMesh.C index 5c41c4c..b94cd67 100644 --- a/src/paraview-plugins/foamReader/library/vtkPVFoamMesh.C +++ b/src/paraview-plugins/foamReader/library/vtkPVFoamMesh.C @@ -179,7 +179,7 @@ void Foam::vtkPVFoam::convertMeshPatches() } } - if (longName.startsWith("group/")) + if (longName.starts_with("group/")) { // Patch group. Collect patch faces. -- GitLab