diff options
author | 2023-03-23 22:34:22 +0100 | |
---|---|---|
committer | 2023-03-23 14:34:22 -0700 | |
commit | 121f4dd882964e6af3ed7fbc4100e67c86b5d574 (patch) | |
tree | 3506283c8f69c9d29481a2b7c51c65c68c3eb9b3 /Source/Diagnostics/BTD_Plotfile_Header_Impl.cpp | |
parent | 04b96737fe1759e55c8ee83cdb783dbf315f9431 (diff) | |
download | WarpX-121f4dd882964e6af3ed7fbc4100e67c86b5d574.tar.gz WarpX-121f4dd882964e6af3ed7fbc4100e67c86b5d574.tar.zst WarpX-121f4dd882964e6af3ed7fbc4100e67c86b5d574.zip |
Fix "modernize-loop-convert" issues found with clang-tidy (#3774)
* Fix all the modernize-loop-convert issues found with clang-tidy
* Fix bug
* Implement @EZoni's suggestions
Diffstat (limited to 'Source/Diagnostics/BTD_Plotfile_Header_Impl.cpp')
-rw-r--r-- | Source/Diagnostics/BTD_Plotfile_Header_Impl.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/Diagnostics/BTD_Plotfile_Header_Impl.cpp b/Source/Diagnostics/BTD_Plotfile_Header_Impl.cpp index 9f858680e..c69a02903 100644 --- a/Source/Diagnostics/BTD_Plotfile_Header_Impl.cpp +++ b/Source/Diagnostics/BTD_Plotfile_Header_Impl.cpp @@ -126,8 +126,8 @@ BTDPlotfileHeaderImpl::WriteHeader () // number of components HeaderFile << m_varnames.size() << '\n'; // write the component string - for (int icomp = 0; icomp < m_varnames.size(); ++icomp ) { - HeaderFile << m_varnames[icomp] << '\n'; + for (const auto& vname : m_varnames) { + HeaderFile << vname << '\n'; } // space dim HeaderFile << m_spacedim << '\n'; @@ -383,12 +383,12 @@ BTDSpeciesHeaderImpl::ReadHeader () is >> m_spacedim; is >> m_num_output_real; m_real_comp_names.resize(m_num_output_real); - for (int i = 0; i < m_real_comp_names.size(); ++i) { - is >> m_real_comp_names[i]; + for (auto& real_comp_name : m_real_comp_names) { + is >> real_comp_name; } is >> m_num_output_int; - for (int i = 0; i < m_int_comp_names.size(); ++i) { - is >> m_int_comp_names[i]; + for (auto& int_comp_name : m_int_comp_names) { + is >> int_comp_name; } is >> m_is_checkpoint; is >> m_total_particles; |