Fix performance-type-promotion-in-math-fn clang-tidy warning (#6908)
This commit is contained in:
committed by
GitHub
parent
163a2cfe3c
commit
1a6f4c44e7
@@ -497,13 +497,13 @@ void encodeVectorTile(const DataFacadeBase &facade,
|
||||
{
|
||||
// Calculate the speed for this line
|
||||
std::uint32_t speed_kmh_idx = static_cast<std::uint32_t>(
|
||||
round(length / from_alias<double>(forward_duration) * 10 * 3.6));
|
||||
std::round(length / from_alias<double>(forward_duration) * 10 * 3.6));
|
||||
|
||||
// Rate values are in meters per weight-unit - and similar to speeds, we
|
||||
// present 1 decimal place of precision (these values are added as
|
||||
// double/10) lower down
|
||||
std::uint32_t forward_rate = static_cast<std::uint32_t>(
|
||||
round(length / from_alias<double>(forward_weight) * 10.));
|
||||
std::round(length / from_alias<double>(forward_weight) * 10.));
|
||||
|
||||
auto tile_line = coordinatesToTileLine(a, b, tile_bbox);
|
||||
if (!tile_line.empty())
|
||||
@@ -531,13 +531,13 @@ void encodeVectorTile(const DataFacadeBase &facade,
|
||||
{
|
||||
// Calculate the speed for this line
|
||||
std::uint32_t speed_kmh_idx = static_cast<std::uint32_t>(
|
||||
round(length / from_alias<double>(reverse_duration) * 10 * 3.6));
|
||||
std::round(length / from_alias<double>(reverse_duration) * 10 * 3.6));
|
||||
|
||||
// Rate values are in meters per weight-unit - and similar to speeds, we
|
||||
// present 1 decimal place of precision (these values are added as
|
||||
// double/10) lower down
|
||||
std::uint32_t reverse_rate = static_cast<std::uint32_t>(
|
||||
round(length / from_alias<double>(reverse_weight) * 10.));
|
||||
std::round(length / from_alias<double>(reverse_weight) * 10.));
|
||||
|
||||
auto tile_line = coordinatesToTileLine(b, a, tile_bbox);
|
||||
if (!tile_line.empty())
|
||||
|
||||
@@ -40,8 +40,8 @@ RasterDatum RasterSource::GetRasterData(const int lon, const int lat) const
|
||||
return {};
|
||||
}
|
||||
|
||||
const std::size_t xth = static_cast<std::size_t>(round((lon - xmin) / xstep));
|
||||
const std::size_t yth = static_cast<std::size_t>(round((ymax - lat) / ystep));
|
||||
const std::size_t xth = static_cast<std::size_t>(std::round((lon - xmin) / xstep));
|
||||
const std::size_t yth = static_cast<std::size_t>(std::round((ymax - lat) / ystep));
|
||||
|
||||
return {raster_data(xth, yth)};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user