Some code improvements.
This commit is contained in:
parent
b41a4afa8b
commit
a5cf8d66df
1 changed files with 3 additions and 7 deletions
|
@ -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)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue