From b417ddf32db3f35ed1757aaa97a04809594cda8e Mon Sep 17 00:00:00 2001 From: Mickey Rose Date: Fri, 29 Jun 2018 16:43:33 +0200 Subject: [PATCH] SConstruct: shortest_name is a one-liner --- SConstruct | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/SConstruct b/SConstruct index 3820c3114..93b9f7245 100644 --- a/SConstruct +++ b/SConstruct @@ -188,13 +188,6 @@ def create_uninstall_target(env, path, is_glob=False): ]) env.Alias("uninstall", "uninstall-"+path) -def shortest_name(libs): - name = '-'*200 - for lib in libs: - if len(name) > len(lib): - name = lib - return name - def rm_path(item,set,_env): for i in _env[set]: if i.startswith(item): @@ -726,7 +719,7 @@ def FindBoost(context, prefixes, thread_flag): if len(libItems) >= 1 and len(incItems) >= 1: BOOST_LIB_DIR = os.path.dirname(libItems[0]) BOOST_INCLUDE_DIR = incItems[0].rstrip('boost/') - shortest_lib_name = shortest_name(libItems) + shortest_lib_name = min(libItems, key=len) match = re.search(r'%s(.*)\..*' % search_lib, shortest_lib_name) if hasattr(match,'groups'): BOOST_APPEND = match.groups()[0]