Some code improvements.

This commit is contained in:
Darko Poljak 2014-08-09 20:52:53 +02:00
parent b41a4afa8b
commit a5cf8d66df

View file

@ -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)