From: Brian Wellington Date: Wed, 20 May 2020 22:23:28 +0000 (-0700) Subject: Remove hash value truncation. X-Git-Tag: v2.0.0rc1~179 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=119e324f668c8d3ca63bb9fadfe151ee673a3645;p=thirdparty%2Fdnspython.git Remove hash value truncation. There's no need to truncate the result of __hash__(); the runtime will already truncate it to sys.hash_info.width. --- diff --git a/dns/name.py b/dns/name.py index caab3bd6..adf39c1b 100644 --- a/dns/name.py +++ b/dns/name.py @@ -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