From: Daniel Arndt Date: Mon, 8 Feb 2021 19:59:43 +0000 (-0500) Subject: Avoid clone() X-Git-Tag: v9.3.0-rc1~426^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb011ccdda3e7d80929b2fa24161c66c7ab296c1;p=dealii.git Avoid clone() --- diff --git a/include/deal.II/base/parameter_handler.h b/include/deal.II/base/parameter_handler.h index 69eed03a24..ec0a32bbdc 100644 --- a/include/deal.II/base/parameter_handler.h +++ b/include/deal.II/base/parameter_handler.h @@ -2333,8 +2333,8 @@ ParameterHandler::add_parameter(const std::string & entry, "that is const. Use a non-const type."); declare_entry(entry, - Patterns::Tools::Convert::to_string( - parameter, *pattern.clone()), + Patterns::Tools::Convert::to_string(parameter, + pattern), pattern, documentation, has_to_be_set); @@ -2345,7 +2345,7 @@ ParameterHandler::add_parameter(const std::string & entry, auto action = [&, pattern_index](const std::string &val) { parameter = Patterns::Tools::Convert::to_value( - val, *patterns[pattern_index]->clone()); + val, patterns[pattern_index]); }; add_action(entry, action); } diff --git a/include/deal.II/base/patterns.h b/include/deal.II/base/patterns.h index d9a8d1e4eb..df712ca77e 100644 --- a/include/deal.II/base/patterns.h +++ b/include/deal.II/base/patterns.h @@ -2292,7 +2292,7 @@ namespace Patterns { std::array::value> a = { {Convert::type>::to_string( - std::get(t), *pattern.get_pattern(U).clone())...}}; + std::get(t), pattern.get_pattern(U))...}}; return a; } @@ -2311,7 +2311,7 @@ namespace Patterns { return std::make_tuple( Convert::type>::to_value( - s[U], *pattern.get_pattern(U).clone())...); + s[U], pattern.get_pattern(U))...); } static T