From 165da6fb65d1048ffa34dc583023054c439e276b Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Wed, 23 May 2018 18:52:25 +0530 Subject: [PATCH] backends: Use a set while gathering RPATHs --- mesonbuild/backend/backends.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 6499105d8..613e4892e 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -355,17 +355,13 @@ class Backend: def determine_rpath_dirs(self, target): link_deps = target.get_all_link_deps() - result = [] + result = set() for ld in link_deps: if ld is target: continue - prospective = self.get_target_dir(ld) - if prospective not in result: - result.append(prospective) - for rp in self.rpaths_for_bundled_shared_libraries(target): - if rp not in result: - result += [rp] - return result + result.add(self.get_target_dir(ld)) + result.update(self.rpaths_for_bundled_shared_libraries(target)) + return list(result) def object_filename_from_source(self, target, source): assert isinstance(source, mesonlib.File)