From ec50b4518465ebcefbbdcb232f04c0a3c294619b Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Fri, 31 Jan 2020 19:36:27 -0800 Subject: [PATCH] Merge setdefault & append lines into one line. --- hash_hardlink.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hash_hardlink.py b/hash_hardlink.py index d3ed98c..55948b2 100644 --- a/hash_hardlink.py +++ b/hash_hardlink.py @@ -34,8 +34,7 @@ def main(argv): inodes.add(file.stat.st_ino) h = hash_file(file) print(file.absolute_path, h) - hashes.setdefault(h, []) - hashes[h].append(file) + hashes.setdefault(h, []).append(file) hashes = {h: files for (h, files) in hashes.items() if len(files) > 1}