Skip to content

Commit

Permalink
minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
chrxh committed Sep 20, 2024
1 parent f8c80db commit 794fa9c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions source/Gui/StatisticsWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,11 +522,12 @@ namespace
{
double getMaxWithDataPointStride(double const* data, double const* timePoints, double startTime, int count)
{
auto constexpr strideDouble = sizeof(DataPointCollection) / sizeof(double);

auto result = 0.0;
auto stride = toInt(sizeof(DataPointCollection) / sizeof(double));
for (int i = count / 20; i < count; ++i) {
if (timePoints[i * stride] >= startTime - NEAR_ZERO) {
result = std::max(result, *reinterpret_cast<double const*>(reinterpret_cast<DataPointCollection const*>(data) + i));
if (timePoints[i * strideDouble] >= startTime - NEAR_ZERO) {
result = std::max(result, data[i * strideDouble]);
}
}
return result;
Expand Down

0 comments on commit 794fa9c

Please sign in to comment.