Skip to content

Commit 95d06fa

Browse files
committed
Fix warning
1 parent 885223e commit 95d06fa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

algorithms/include/gdx/algo/masking.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ template <typename RasterType, typename MaskType>
3131
template <typename RasterType, typename MaskType>
3232
void erase_outside_mask(RasterType& ras, const MaskType& mask)
3333
{
34-
int size = int(mask.size());
34+
auto size = mask.size();
3535
if (size != ras.size()) {
3636
throw InvalidArgument("erase outside mask : size of mask {} should match size of raster {}", size, ras.size());
3737
}
3838
if (ras.nodata().has_value()) {
39-
for (int32_t j = 0; j < size; ++j) {
39+
for (int32_t j = 0; j < inf::truncate<int32_t>(size); ++j) {
4040
if (mask[j] == 0 || mask.is_nodata(j)) {
4141
ras[j] = ras.NaN;
4242
ras.mark_as_nodata(j);
4343
}
4444
}
4545
} else {
46-
for (int32_t j = 0; j < size; ++j) {
46+
for (int32_t j = 0; j < inf::truncate<int32_t>(size); ++j) {
4747
if (mask[j] == 0 || mask.is_nodata(j)) {
4848
ras[j] = 0;
4949
}

0 commit comments

Comments
 (0)