mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-26 20:54:22 +01:00
Only rescan libraries folders when really needed
Scanning libraries is an heavy task if the sketchbook becomes huge; This patch targets two points: - remove the rescan() after setLibrariesFolders(), which already performs a rescan - call setLibrariesFolders() only when the folder list has changed - This ensures that no scan is performed when changing board in the same architecture Could mitigate #6350
This commit is contained in:
parent
1fd794dfdb
commit
73f40ac32e
@ -106,6 +106,10 @@ public class LibrariesIndexer {
|
||||
rescanLibraries();
|
||||
}
|
||||
|
||||
public List<File> getLibrariesFolders() {
|
||||
return librariesFolders;
|
||||
}
|
||||
|
||||
public void rescanLibraries() {
|
||||
// Clear all installed flags
|
||||
installedLibraries.clear();
|
||||
|
@ -679,8 +679,9 @@ public class BaseNoGui {
|
||||
// Libraries located in the latest folders on the list can override
|
||||
// other libraries with the same name.
|
||||
librariesIndexer.setSketchbookLibrariesFolder(getSketchbookLibrariesFolder());
|
||||
librariesIndexer.setLibrariesFolders(librariesFolders);
|
||||
librariesIndexer.rescanLibraries();
|
||||
if (librariesIndexer.getLibrariesFolders() == null || !librariesIndexer.getLibrariesFolders().equals(librariesFolders)) {
|
||||
librariesIndexer.setLibrariesFolders(librariesFolders);
|
||||
}
|
||||
|
||||
populateImportToLibraryTable();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user