From e10a2dadd3c0531bc13ead8d80fddb2df51afed1 Mon Sep 17 00:00:00 2001 From: Prodesire Date: Sun, 26 Nov 2017 15:13:45 +0800 Subject: [PATCH] improve min method in common_prefix --- pydu/string.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pydu/string.py b/pydu/string.py index 4b90408..f911271 100644 --- a/pydu/string.py +++ b/pydu/string.py @@ -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: