Skip to content

Commit 31156ba

Browse files
committed
Slightly optimize library resolution
Even when there is only one candidate library for a particular header we should always check if the library is already included. Signed-off-by: Cristian Maglie <[email protected]>
1 parent e46d5e3 commit 31156ba

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/arduino.cc/builder/resolve_library.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ func ResolveLibrary(ctx *types.Context, header string) *types.Library {
5555
return nil
5656
}
5757

58-
if len(libraries) == 1 {
59-
return libraries[0]
60-
}
61-
6258
if markImportedLibraryContainsOneOfCandidates(markImportedLibrary, libraries) {
6359
return nil
6460
}
6561

62+
if len(libraries) == 1 {
63+
return libraries[0]
64+
}
65+
6666
reverse(libraries)
6767

6868
var library *types.Library

0 commit comments

Comments
 (0)