From e39258bacc722ea9e7446c93b6443b8e1923e3a4 Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Wed, 26 Mar 2014 17:38:26 +0000 Subject: [PATCH 44/72] Dead code removal: sos.plugins.common_prefix() Unused. Delete. Signed-off-by: Bryn M. Reeves --- sos/plugins/__init__.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py index 9ee0b61..4de8c0d 100644 --- a/sos/plugins/__init__.py +++ b/sos/plugins/__init__.py @@ -45,19 +45,6 @@ try: except ImportError: import simplejson as json -def common_prefix(l1, l2, common = None): - """Returns a tuple like the following: - ([common, elements, from l1, and l2], [[tails, from, l1], [tails, from, l2]]) - - >>> common_prefix(['usr','share','foo'], ['usr','share','bar']) - (['usr','share'], [['foo'], ['bar']]) - """ - if common is None: - common = [] - if len(l1) < 1 or len(l2) < 1 or l1[0] != l2[0]: - return (common, [l1, l2]) - return common_prefix(l1[1:], l2[1:], common+[l1[0]]) - def regex_findall(regex, fname): '''Return a list of all non overlapping matches in the string(s)''' try: -- 1.9.3