Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 21, 2024
1 parent 9508c50 commit 981fb2e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
21 changes: 8 additions & 13 deletions src/ChunkInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,16 @@ namespace host_info
Method methodFromStringDescription(
std::string const &descr, [[maybe_unused]] bool consider_mpi)
{
static std::map<std::string, Method> const map
{
static std::map<std::string, Method> const map{
{"posix_hostname", Method::POSIX_HOSTNAME},
#if openPMD_HAVE_MPI
{"hostname",
consider_mpi ? Method::MPI_PROCESSOR_NAME
: Method::POSIX_HOSTNAME},
{"hostname",
consider_mpi ? Method::MPI_PROCESSOR_NAME
: Method::POSIX_HOSTNAME},
#else
{"hostname", Method::POSIX_HOSTNAME},
{"hostname", Method::POSIX_HOSTNAME},
#endif
{
"mpi_processor_name", Method::MPI_PROCESSOR_NAME
}
};
{"mpi_processor_name", Method::MPI_PROCESSOR_NAME}};
return map.at(descr);
}

Expand All @@ -101,13 +97,12 @@ namespace host_info

std::string byMethod(Method method)
{
static std::map<Method, std::string (*)()> const map
{
static std::map<Method, std::string (*)()> const map{
#if openPMD_POSIX_AVAILABLE
{Method::POSIX_HOSTNAME, &posix_hostname},
#endif
#if openPMD_HAVE_MPI
{Method::MPI_PROCESSOR_NAME, &mpi_processor_name},
{Method::MPI_PROCESSOR_NAME, &mpi_processor_name},
#endif
};
try
Expand Down
4 changes: 2 additions & 2 deletions src/IO/AbstractIOHandlerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ namespace
using self_or_invoked_t = typename self_or_invoked<T>::type;

template <typename DeferredString>
auto undefer_string(DeferredString &&str)
-> self_or_invoked_t<DeferredString &&>
auto
undefer_string(DeferredString &&str) -> self_or_invoked_t<DeferredString &&>
{
if constexpr (std::is_invocable_v<DeferredString &&>)
{
Expand Down

0 comments on commit 981fb2e

Please sign in to comment.