Skip to content

Commit 7807e74

Browse files
victorgvelosoObserverOfTime
authored andcommitted
fix: lazily invoke findLibrary (#152)
1 parent a05e79c commit 7807e74

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/io/github/treesitter/jtreesitter/internal/ChainedLibraryLookup.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ public SymbolLookup get(Arena arena) {
2020
for (var libraryLookup : serviceLoader) {
2121
lookup = lookup.or(libraryLookup.get(arena));
2222
}
23-
return lookup.or(findLibrary(arena)).or(Linker.nativeLinker().defaultLookup());
23+
24+
return lookup.or((name) -> findLibrary(arena).find(name)).or(Linker.nativeLinker().defaultLookup());
2425
}
2526

2627
private static SymbolLookup findLibrary(Arena arena) {

0 commit comments

Comments
 (0)