mirror of https://github.com/flaggo/pydu.git
improve min method in common_prefix
This commit is contained in:
parent
7725d9ed41
commit
e10a2dadd3
|
@ -103,7 +103,7 @@ def strips(text, remove):
|
|||
|
||||
def common_prefix(l):
|
||||
commons = []
|
||||
for i in range(len(min(l, key=len))):
|
||||
for i in range(min(len(s) for s in l)):
|
||||
common = l[0][i]
|
||||
for c in l[1:]:
|
||||
if c[i] != common:
|
||||
|
|
Loading…
Reference in New Issue