Skip to content

Commit 5ea2e4b

Browse files
committed
Use constant ZOOM_MAX
1 parent c4ad5eb commit 5ea2e4b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/command-line-parser.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,16 @@ void check_options_expire(options_t *options)
229229
{
230230
// Zoom level 31 is the technical limit because we use 32-bit integers for
231231
// the x and y index of a tile ID.
232-
if (options->expire_tiles_zoom_min > 31) {
233-
options->expire_tiles_zoom_min = 31;
232+
constexpr uint32_t ZOOM_MAX = 31;
233+
234+
if (options->expire_tiles_zoom_min > ZOOM_MAX) {
235+
options->expire_tiles_zoom_min = ZOOM_MAX;
234236
log_warn("Minimum zoom level for tile expiry is too "
235237
"large and has been set to 31.");
236238
}
237239

238-
if (options->expire_tiles_zoom > 31) {
239-
options->expire_tiles_zoom = 31;
240+
if (options->expire_tiles_zoom > ZOOM_MAX) {
241+
options->expire_tiles_zoom = ZOOM_MAX;
240242
log_warn("Maximum zoom level for tile expiry is too "
241243
"large and has been set to 31.");
242244
}

0 commit comments

Comments
 (0)