Replace chunk_size=None with CHUNK_SIZE.

The idea was that you could overwrite the module-level CHUNK_SIZE so
that all future quickids would use it as the default, but I don't like
the code clutter and anybody who wants to change the default should
write their own partial function if it's that important.
This commit is contained in:
Ethan Dalool 2020-09-09 14:39:30 -07:00
parent d95d1c9533
commit 331de6eaec

View file

@ -55,10 +55,7 @@ def matches_file(filename, other_id):
with open(filename, 'rb') as handle:
return matches_handle(handle, other_id)
def quickid_handle(handle, hashtype='md5', chunk_size=None):
if chunk_size is None:
chunk_size = CHUNK_SIZE
def quickid_handle(handle, hashtype='md5', chunk_size=CHUNK_SIZE):
hasher = HASH_CLASSES[hashtype]()
size = handle.seek(0, SEEK_END)
handle.seek(0)