diff shasum.py @ 57:0fa2067bedb8

Common initialization is now common when computing the hashes from a mmap
author Franz Glasner <f.glasner@feldmann-mg.com>
date Tue, 08 Feb 2022 17:13:15 +0100
parents 6e91c530545f
children ae5b31c10b41
line wrap: on
line diff
--- a/shasum.py	Tue Feb 08 17:09:52 2022 +0100
+++ b/shasum.py	Tue Feb 08 17:13:15 2022 +0100
@@ -484,10 +484,9 @@
             # mmap
             if filesize < MAP_CHUNK_SIZE:
                 mapsize = filesize
-                mapoffset = 0
             else:
                 mapsize = MAP_CHUNK_SIZE
-                mapoffset = 0
+            mapoffset = 0
             rest = filesize
             while rest > 0:
                 m = mmap.mmap(fd,