Skip to content

Commit 7564ac3

Browse files
authored
Used sorted function instead of if statements (#109)
1 parent e38c05d commit 7564ac3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

samgeo/common.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -512,10 +512,8 @@ def draw_tile(
512512
):
513513
x0, y0 = deg2num(lat0, lon0, zoom)
514514
x1, y1 = deg2num(lat1, lon1, zoom)
515-
if x0 > x1:
516-
x0, x1 = x1, x0
517-
if y0 > y1:
518-
y0, y1 = y1, y0
515+
x0, x1 = sorted([x0, x1])
516+
y0, y1 = sorted([y0, y1])
519517
corners = tuple(
520518
itertools.product(
521519
range(math.floor(x0), math.ceil(x1)),

0 commit comments

Comments
 (0)