Skip to content

Commit 600d1c3

Browse files
authored
Merge pull request #2694 from Pinata-Consulting/cts-warning-fix
cts: fix a warning
2 parents bc67783 + 1776d51 commit 600d1c3

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/cts/src/Clock.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,16 @@ Box<int> Clock::computeSinkRegion()
9090
Box<double> Clock::computeSinkRegionClustered(
9191
std::vector<std::pair<float, float>> sinks)
9292
{
93-
double xMin = std::numeric_limits<double>::max();
94-
double xMax = std::numeric_limits<double>::lowest();
95-
double yMin = std::numeric_limits<double>::max();
96-
double yMax = std::numeric_limits<double>::lowest();
97-
98-
for (const std::pair<double, double>& sinkLocation : sinks) {
99-
xMin = std::min(xMin, sinkLocation.first);
100-
xMax = std::max(xMax, sinkLocation.first);
101-
yMin = std::min(yMin, sinkLocation.second);
102-
yMax = std::max(yMax, sinkLocation.second);
93+
auto xMin = std::numeric_limits<float>::max();
94+
auto xMax = std::numeric_limits<float>::lowest();
95+
auto yMin = std::numeric_limits<float>::max();
96+
auto yMax = std::numeric_limits<float>::lowest();
97+
98+
for (const auto [sinkX, sinkY] : sinks) {
99+
xMin = std::min(xMin, sinkX);
100+
xMax = std::max(xMax, sinkX);
101+
yMin = std::min(yMin, sinkY);
102+
yMax = std::max(yMax, sinkY);
103103
}
104104

105105
return Box<double>(xMin, yMin, xMax, yMax);

0 commit comments

Comments
 (0)