diff --git a/sweeper/sweeper.py b/sweeper/sweeper.py index 79b279d..fc5aabe 100644 --- a/sweeper/sweeper.py +++ b/sweeper/sweeper.py @@ -109,11 +109,7 @@ def _filehash(filepath, hashalg, block_size): def _uniq_list(list_): - result = [] - for foo in list_: - if foo not in result: - result.append(foo) - return result + return set(list_) def _gather_file_list(dirs): @@ -128,8 +124,8 @@ def _gather_file_list(dirs): for dirpath, dirnames, filenames in os.walk(dir_): count += len(filenames) # replace fpath with realpath value (eliminate symbolic links) - files += [os.path.realpath(os.path.join(dirpath, fname)) - for fname in filenames] + files.extend([os.path.realpath(os.path.join(dirpath, fname)) + for fname in filenames]) return (count, files)