]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Remove hash value truncation.
authorBrian Wellington <bwelling@xbill.org>
Wed, 20 May 2020 22:23:28 +0000 (15:23 -0700)
committerBrian Wellington <bwelling@xbill.org>
Wed, 20 May 2020 22:23:28 +0000 (15:23 -0700)
There's no need to truncate the result of __hash__(); the runtime will
already truncate it to sys.hash_info.width.

dns/name.py

index caab3bd6d0c2bcc7472f5355f377e076d64b2cd2..adf39c1b2fa9b03eee136516319aebe654b18f96 100644 (file)
@@ -20,7 +20,6 @@
 
 import copy
 import struct
-import sys
 
 import encodings.idna    # type: ignore
 try:
@@ -32,8 +31,6 @@ except ImportError:
 import dns.exception
 import dns.wiredata
 
-maxint = sys.maxsize
-
 # fullcompare() result values
 
 #: The compared names have no relationship to each other.
@@ -370,7 +367,7 @@ class Name(object):
         for label in self.labels:
             for c in label.lower():
                 h += (h << 3) + c
-        return h % maxint
+        return h
 
     def fullcompare(self, other):
         """Compare two names, returning a 3-tuple