From 5ab5dc70cca6491fd61831d848bb8ee230f5ee2c Mon Sep 17 00:00:00 2001 From: David Grote Date: Wed, 8 Mar 2023 14:05:13 -0800 Subject: Fix handling of name passed into SetTag (#3735) * Fix handling of name passed into SetTag * Make name a reference in AddToMultiFabMap --- Source/WarpX.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Source/WarpX.cpp') diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index 465b993a8..0f57cbee1 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -2958,10 +2958,10 @@ WarpX::AllocInitMultiFab ( const amrex::DistributionMapping& dm, const int ncomp, const amrex::IntVect& ngrow, - const std::string name, + const std::string& name, std::optional initial_value) { - const auto tag = amrex::MFInfo().SetTag(std::move(name)); + const auto tag = amrex::MFInfo().SetTag(name); mf = std::make_unique(ba, dm, ncomp, ngrow, tag); if (initial_value) { mf->setVal(*initial_value); @@ -2976,10 +2976,10 @@ WarpX::AllocInitMultiFab ( const amrex::DistributionMapping& dm, const int ncomp, const amrex::IntVect& ngrow, - const std::string name, + const std::string& name, std::optional initial_value) { - const auto tag = amrex::MFInfo().SetTag(std::move(name)); + const auto tag = amrex::MFInfo().SetTag(name); mf = std::make_unique(ba, dm, ncomp, ngrow, tag); if (initial_value) { mf->setVal(*initial_value); @@ -2993,7 +2993,7 @@ WarpX::AliasInitMultiFab ( const amrex::MultiFab& mf_to_alias, const int scomp, const int ncomp, - const std::string name, + const std::string& name, std::optional initial_value) { mf = std::make_unique(mf_to_alias, amrex::make_alias, scomp, ncomp); -- cgit v1.2.3