Skip to content

Commit 80c6330

Browse files
The9CatCopilot
andauthored
Update src/Component.cc
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 7be9753 commit 80c6330

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/Component.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2509,7 +2509,11 @@ void Component::write_HDF5(HighFive::Group& group, bool masses, bool IDs)
25092509
if (H5chunk >= nbodies) {
25102510
chunk = nbodies/8;
25112511
}
2512-
chunk = std::max(1, std::min(chunk, nbodies));
2512+
if (chunk < 1) {
2513+
chunk = 1;
2514+
} else if (static_cast<unsigned int>(chunk) > nbodies) {
2515+
chunk = static_cast<int>(nbodies);
2516+
}
25132517

25142518
dcpl1.add(HighFive::Chunking(chunk));
25152519
if (H5shuffle) dcpl1.add(HighFive::Shuffle());

0 commit comments

Comments
 (0)