ENH: use back(), pop_back() instead remove()

- adjust looping to resemble LIFO pattern

STYLE: adjust some string includes
This commit is contained in:
Mark Olesen
2023-01-26 12:36:53 +01:00
parent 7c60c80edd
commit eb8b51b475
25 changed files with 125 additions and 132 deletions

View File

@ -38,7 +38,6 @@ SourceFiles
#define FIRECore_H
#include "point.H"
#include "string.H"
#include "labelList.H"
#include "pointField.H"
#include "IOstreams.H"

View File

@ -38,7 +38,6 @@ SourceFiles
#define Foam_fileFormats_NASCore_H
#include "scalar.H"
#include "string.H"
#include "Enum.H"
#include "face.H"
#include "point.H"

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2022 OpenCFD Ltd.
Copyright (C) 2018-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -399,18 +399,17 @@ Foam::label Foam::vtk::vtmWriter::endBlock(const word& blockName)
{
if (!blocks_.empty())
{
const word curr(blocks_.remove());
// Verify expected end tag
if (!blockName.empty() && blockName != curr)
if (!blockName.empty() && blockName != blocks_.back())
{
WarningInFunction
<< "expecting to end block '" << blockName
<< "' but found '" << curr << "' instead"
<< "' but found '" << blocks_.back() << "' instead"
<< endl;
}
entries_.append(vtmEntry::endblock());
blocks_.pop_back();
entries_.push_back(vtmEntry::endblock());
}
return blocks_.size();

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2022 OpenCFD Ltd.
Copyright (C) 2016-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -112,7 +112,7 @@ Foam::vtk::formatter& Foam::vtk::formatter::closeTag(const bool isEmpty)
if (isEmpty)
{
// Eg, <tag ... />
xmlTags_.remove();
xmlTags_.pop_back();
os_ << " /";
}
os_ << '>' << nl;
@ -124,7 +124,8 @@ Foam::vtk::formatter& Foam::vtk::formatter::closeTag(const bool isEmpty)
Foam::vtk::formatter& Foam::vtk::formatter::endTag(const word& tagName)
{
const word curr(xmlTags_.remove());
const word curr(std::move(xmlTags_.back()));
xmlTags_.pop_back();
indent();
if (inTag_)