From 766d71146a8314a48db88f29b0e0548d1d9c5397 Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Wed, 26 Jul 2023 20:55:34 +0200 Subject: Initialize variables at declaration if it improves readability (#4117) * init some variables at declaration * make code more readable * avoid lossy function result cast * Update Source/Initialization/WarpXInitData.cpp Co-authored-by: Weiqun Zhang * replace with equality * Revert "replace with equality" This reverts commit e3164f9e053d345b153d770ae107a7f68c4bb260. * Update Source/Diagnostics/ComputeDiagFunctors/ParticleReductionFunctor.cpp Co-authored-by: Weiqun Zhang --------- Co-authored-by: Weiqun Zhang --- Source/FieldSolver/SpectralSolver/SpectralKSpace.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'Source/FieldSolver/SpectralSolver/SpectralKSpace.cpp') diff --git a/Source/FieldSolver/SpectralSolver/SpectralKSpace.cpp b/Source/FieldSolver/SpectralSolver/SpectralKSpace.cpp index 7320b7cf1..b8d81000c 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralKSpace.cpp +++ b/Source/FieldSolver/SpectralSolver/SpectralKSpace.cpp @@ -68,14 +68,9 @@ SpectralKSpace::SpectralKSpace( const BoxArray& realspace_ba, spectralspace_ba.define( spectral_bl ); // Allocate the components of the k vector: kx, ky (only in 3D), kz - bool only_positive_k; for (int i_dim=0; i_dim