From 86ddcfd4eac493f0bcd38a824952e70567e4886b Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Sat, 8 Aug 2020 07:21:37 -0700 Subject: LOC _exponent_of does not need to do division. --- dns/rdtypes/ANY/LOC.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/dns/rdtypes/ANY/LOC.py b/dns/rdtypes/ANY/LOC.py index f3e3e12..c9e985b 100644 --- a/dns/rdtypes/ANY/LOC.py +++ b/dns/rdtypes/ANY/LOC.py @@ -34,17 +34,13 @@ _MIN_LATITUDE = 0x80000000 - 90 * 3600000 _MAX_LONGITUDE = 0x80000000 + 180 * 3600000 _MIN_LONGITUDE = 0x80000000 - 180 * 3600000 -# pylint complains about division since we don't have a from __future__ for -# it, but we don't care about python 2 warnings, so turn them off. -# -# pylint: disable=old-division def _exponent_of(what, desc): if what == 0: return 0 exp = None for (i, pow) in enumerate(_pows): - if what // pow == 0: + if what < pow: exp = i - 1 break if exp is None or exp < 0: -- cgit v1.2.1