From 119e324f668c8d3ca63bb9fadfe151ee673a3645 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Wed, 20 May 2020 15:23:28 -0700 Subject: [PATCH] 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. --- dns/name.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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 -- 2.47.3