Skip to content

Commit 3155323

Browse files
committed
Renamed some variables to improve code readability
1 parent a35055e commit 3155323

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Diff for: arduino/cores/packagemanager/loader.go

+5-6
Original file line numberDiff line numberDiff line change
@@ -453,20 +453,19 @@ func (pm *PackageManager) loadBoards(platform *cores.PlatformRelease) error {
453453
}
454454

455455
boardsTxtPath := platform.InstallDir.Join("boards.txt")
456-
boardsProperties, err := properties.LoadFromPath(boardsTxtPath)
456+
allBoardsProperties, err := properties.LoadFromPath(boardsTxtPath)
457457
if err != nil {
458458
return err
459459
}
460460

461461
boardsLocalTxtPath := platform.InstallDir.Join("boards.local.txt")
462-
if localProperties, err := properties.SafeLoadFromPath(boardsLocalTxtPath); err == nil {
463-
boardsProperties.Merge(localProperties)
462+
if boardsLocalProperties, err := properties.SafeLoadFromPath(boardsLocalTxtPath); err == nil {
463+
allBoardsProperties.Merge(boardsLocalProperties)
464464
} else {
465465
return err
466466
}
467467

468-
propertiesByBoard := boardsProperties.FirstLevelOf()
469-
468+
propertiesByBoard := allBoardsProperties.FirstLevelOf()
470469
if menus, ok := propertiesByBoard["menu"]; ok {
471470
platform.Menus = menus
472471
} else {
@@ -479,7 +478,7 @@ func (pm *PackageManager) loadBoards(platform *cores.PlatformRelease) error {
479478
skippedBoards := []string{}
480479
for boardID, boardProperties := range propertiesByBoard {
481480
var board *cores.Board
482-
for key := range boardProperties.AsMap() {
481+
for _, key := range boardProperties.Keys() {
483482
if !strings.HasPrefix(key, "menu.") {
484483
continue
485484
}

0 commit comments

Comments
 (0)