From 8cd0e68e0d898287a15ec1b72561ba2f87de6dd8 Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Wed, 13 Jan 2021 16:19:18 +0100 Subject: [PATCH] Fixed WB comments. --- include/deal.II/base/parameter_acceptor.h | 4 ++-- source/base/parameter_acceptor.cc | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/deal.II/base/parameter_acceptor.h b/include/deal.II/base/parameter_acceptor.h index 51653b9f3a..d880718730 100644 --- a/include/deal.II/base/parameter_acceptor.h +++ b/include/deal.II/base/parameter_acceptor.h @@ -519,11 +519,11 @@ public: /** * Add the given @p subsection to the global path stored in this class. * - * This function changes the behaviour of enter_my_subsection(), by + * This function changes the behavior of enter_my_subsection(), by * appending a new subsection to the path stored in this class. * * This method can be used to split the parameters of this class into - * subsections, while still maintaining the general behaviour of this + * subsections, while still maintaining the general behavior of this * class. * * An example usage is given by the following snippet: diff --git a/source/base/parameter_acceptor.cc b/source/base/parameter_acceptor.cc index 1dfbcfb8a9..f1380d2a8a 100644 --- a/source/base/parameter_acceptor.cc +++ b/source/base/parameter_acceptor.cc @@ -204,9 +204,10 @@ ParameterAcceptor::enter_subsection(const std::string &subsection) AssertThrow(subsection.find(sep) == std::string::npos, ExcMessage( "A subsection name cannot contain the special character '/'")); - // First the easy case. - if (subsection == "") - return; + + AssertThrow(subsection != "", + ExcMessage("Cannot create an empty subsection.")); + subsections.push_back(subsection); } -- 2.39.5