Skip to content

Commit

Permalink
Do not double read when actual matches requested
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfpeterson committed Dec 27, 2024
1 parent da86e0b commit bd40668
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Framework/Nexus/src/H5Util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,15 +380,13 @@ std::vector<NumT> readNumArrayAttributeCoerce(const H5::H5Object &object, const
}

template <typename NumT> void readArray1DCoerce(const DataSet &dataset, std::vector<NumT> &output) {
DataType dataType = dataset.getDataType();
const DataType dataType = dataset.getDataType();

if (getType<NumT>() == dataType) { // no conversion necessary
DataSpace dataSpace = dataset.getSpace();
output.resize(dataSpace.getSelectNpoints());
const DataSpace dataSpace = dataset.getSpace();
output.resize(static_cast<size_t>(dataSpace.getSelectNpoints()));
dataset.read(output.data(), dataType, dataSpace);
}

if (PredType::NATIVE_INT32 == dataType) {
} else if (PredType::NATIVE_INT32 == dataType) {
convertingRead<int32_t>(dataset, dataType, output);
} else if (PredType::NATIVE_UINT32 == dataType) {
convertingRead<uint32_t>(dataset, dataType, output);
Expand Down

0 comments on commit bd40668

Please sign in to comment.