diff --git a/src/complex/Utilities/OStreamUtilities.cpp b/src/complex/Utilities/OStreamUtilities.cpp index 3b0205452b..2583f54510 100644 --- a/src/complex/Utilities/OStreamUtilities.cpp +++ b/src/complex/Utilities/OStreamUtilities.cpp @@ -150,6 +150,7 @@ struct PrintDataArray maxLine = static_cast(dataArray.getNumberOfComponents()); } + usize numComps = dataArray.getNumberOfComponents(); for(size_t tuple = 0; tuple < numTuples; tuple++) { auto now = std::chrono::steady_clock::now(); @@ -163,19 +164,19 @@ struct PrintDataArray return {}; } } - for(size_t index = 0; index < dataArray.getNumberOfComponents(); index++) + for(size_t index = 0; index < numComps; index++) { if constexpr(std::is_same_v || std::is_same_v) { - outputStrm << static_cast(dataArray[index]); + outputStrm << static_cast(dataArray[tuple * numComps + index]); } else if constexpr(std::is_same_v || std::is_same_v) { - outputStrm << fmt::format("{}", dataArray[index]); + outputStrm << fmt::format("{}", dataArray[tuple * numComps + index]); } else { - outputStrm << dataArray[index]; + outputStrm << dataArray[tuple * numComps + index]; } if(index != maxLine - 1) {