Skip to content

Commit

Permalink
address PR review comments from @alwinm & @bcaddy
Browse files Browse the repository at this point in the history
- removed an unnecessary include-directive
- fixed a double-negative boolean negation operation (I previously wrote `!!` when it should have just been `!`)
- replaced `!` operator with `not` keyword and `||` operator with `or` keyword
  • Loading branch information
mabruzzo committed Sep 7, 2023
1 parent b441372 commit 44f8dd0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/io/io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#ifdef HDF5
#include <hdf5.h>
#endif // HDF5
Expand Down Expand Up @@ -47,7 +46,7 @@ static inline bool Is_Root_Proc()

void Create_Log_File(struct parameters P)
{
if (!Is_Root_Proc()) {
if (not Is_Root_Proc()) {
return;
}

Expand Down Expand Up @@ -75,7 +74,7 @@ void Create_Log_File(struct parameters P)

void Write_Message_To_Log_File(const char *message)
{
if (!!Is_Root_Proc()) {
if (not Is_Root_Proc()) {
return;
}

Expand Down Expand Up @@ -2597,7 +2596,7 @@ int chprintf(const char *__restrict sdata, ...) // NOLINT(cert-dcl50-cpp)
{
int code = 0;
/*limit printf to root process only*/
if (!Is_Root_Proc()) {
if (not Is_Root_Proc()) {
va_list ap;
va_start(ap, sdata);
code = vfprintf(stdout, sdata, ap); // NOLINT(clang-analyzer-valist.Uninitialized)
Expand Down Expand Up @@ -2686,7 +2685,7 @@ void Ensure_Outdir_Exists(std::string outdir)
// confirm that an error-code wasn't set & that the path actually refers
// to a directory (it's unclear from docs whether err-code is set in that
// case)
if (err_code || !std::filesystem::is_directory(without_file_prefix)) {
if (err_code or not std::filesystem::is_directory(without_file_prefix)) {
chprintf(
"something went wrong while trying to create the path to the "
"output-dir: %s\n",
Expand Down

0 comments on commit 44f8dd0

Please sign in to comment.