Skip to content

Commit f47f825

Browse files
pre-commit-ci[bot]franzpoeschel
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 01d2789 commit f47f825

1 file changed

Lines changed: 23 additions & 21 deletions

File tree

include/openPMD/IO/ADIOS/ADIOS2IOHandler.hpp

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -509,32 +509,34 @@ class ADIOS2IOHandlerImpl
509509
}
510510
else
511511
{
512-
if (var.ShapeID() == adios2::ShapeID::JoinedArray)
513-
{
514-
// When you reach here due to a mysterious inconsistency observed from time to time
515-
// e.g. adios2::JoinedDim=(~(size_t)0) which for 64 bits = 18446744073709551615
516-
// but the particle shape, when printed out, turns out to be
517-
// [18446744073709551614]
518-
//
519-
if (!offset.empty())
520-
{
521-
throw std::runtime_error(
522-
"[ADIOS2] Offset must be an empty vector in case of joined "
523-
"array.");
524-
}
525-
}
526-
else
527-
{
528-
for (unsigned int i = 0; i < actualDim; i++)
512+
if (var.ShapeID() == adios2::ShapeID::JoinedArray)
529513
{
530-
if (!(joinedDim.has_value() && *joinedDim == i) &&
531-
offset[i] + extent[i] > shape[i])
514+
// When you reach here due to a mysterious inconsistency
515+
// observed from time to time e.g.
516+
// adios2::JoinedDim=(~(size_t)0) which for 64 bits =
517+
// 18446744073709551615 but the particle shape, when printed
518+
// out, turns out to be [18446744073709551614]
519+
//
520+
if (!offset.empty())
532521
{
533522
throw std::runtime_error(
534-
"[ADIOS2] Dataset access out of bounds.");
523+
"[ADIOS2] Offset must be an empty vector in case of "
524+
"joined "
525+
"array.");
535526
}
536527
}
537-
}// else
528+
else
529+
{
530+
for (unsigned int i = 0; i < actualDim; i++)
531+
{
532+
if (!(joinedDim.has_value() && *joinedDim == i) &&
533+
offset[i] + extent[i] > shape[i])
534+
{
535+
throw std::runtime_error(
536+
"[ADIOS2] Dataset access out of bounds.");
537+
}
538+
}
539+
} // else
538540
}
539541

540542
var.SetSelection(

0 commit comments

Comments
 (0)