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_):
|
def _uniq_list(list_):
|
||||||
result = []
|
return set(list_)
|
||||||
for foo in list_:
|
|
||||||
if foo not in result:
|
|
||||||
result.append(foo)
|
|
||||||
return result
|
|
||||||
|
|
||||||
|
|
||||||
def _gather_file_list(dirs):
|
def _gather_file_list(dirs):
|
||||||
|
@ -128,8 +124,8 @@ def _gather_file_list(dirs):
|
||||||
for dirpath, dirnames, filenames in os.walk(dir_):
|
for dirpath, dirnames, filenames in os.walk(dir_):
|
||||||
count += len(filenames)
|
count += len(filenames)
|
||||||
# replace fpath with realpath value (eliminate symbolic links)
|
# replace fpath with realpath value (eliminate symbolic links)
|
||||||
files += [os.path.realpath(os.path.join(dirpath, fname))
|
files.extend([os.path.realpath(os.path.join(dirpath, fname))
|
||||||
for fname in filenames]
|
for fname in filenames])
|
||||||
return (count, files)
|
return (count, files)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue