From db8a619f517f18d6efdfd25cc7758cbab757f39c Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Wed, 27 Mar 2024 18:36:55 -0700 Subject: [PATCH] Apply suggestions from code review --- Src/Base/AMReX_MultiFab.H | 2 +- Src/Base/AMReX_MultiFab.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Src/Base/AMReX_MultiFab.H b/Src/Base/AMReX_MultiFab.H index 6cb4c46e7df..8ec62700cc1 100644 --- a/Src/Base/AMReX_MultiFab.H +++ b/Src/Base/AMReX_MultiFab.H @@ -492,7 +492,7 @@ public: * This uses the same arena and factory in the copy and copies * all data. */ - MultiFab deepCopy (); + [[nodiscard]] MultiFab deepCopy () const; /** * \brief Copy from src to dst including nghost ghost cells. diff --git a/Src/Base/AMReX_MultiFab.cpp b/Src/Base/AMReX_MultiFab.cpp index 41ec0093b62..2a80123836b 100644 --- a/Src/Base/AMReX_MultiFab.cpp +++ b/Src/Base/AMReX_MultiFab.cpp @@ -168,9 +168,9 @@ MultiFab::Add (MultiFab& dst, const MultiFab& src, } MultiFab -MultiFab::deepCopy () +MultiFab::deepCopy () const { - auto mf = MultiFab( + MultiFab mf( this->boxArray(), this->DistributionMap(), this->nComp(),