Skip to content

Commit

Permalink
Avoid adding duplicated items in systemLib soSource
Browse files Browse the repository at this point in the history
Summary: This diff simply uses `Set<String>`  to avoid adding same path in systemLib soSource.

Reviewed By: charles011

Differential Revision: D32052024

fbshipit-source-id: 90810a061becd4c5ae4584640e05819272d8753c
  • Loading branch information
simpleton authored and facebook-github-bot committed Nov 1, 2021
1 parent c97b1b8 commit 268abd6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion java/com/facebook/soloader/SoLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,8 @@ private static void AddSystemLibSoSource(ArrayList<SoSource> soSources, String[]
systemLibPaths += ":" + LD_LIBRARY_PATH;
}

for (String libPath : systemLibPaths.split(":")) {
final Set<String> libPathSet = new HashSet<>(Arrays.asList(systemLibPaths.split(":")));
for (String libPath : libPathSet) {
// Don't pass DirectorySoSource.RESOLVE_DEPENDENCIES for directories we find on
// LD_LIBRARY_PATH: Bionic's dynamic linker is capable of correctly resolving dependencies
// these libraries have on each other, so doing that ourselves would be a waste.
Expand Down

0 comments on commit 268abd6

Please sign in to comment.