Skip to content

Commit 1266878

Browse files
committed
Renamed some variables to improve code readability
1 parent 0292620 commit 1266878

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

arduino/cores/packagemanager/loader.go

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

471471
boardsTxtPath := platform.InstallDir.Join("boards.txt")
472-
boardsProperties, err := properties.LoadFromPath(boardsTxtPath)
472+
allBoardsProperties, err := properties.LoadFromPath(boardsTxtPath)
473473
if err != nil {
474474
return err
475475
}
476476

477477
boardsLocalTxtPath := platform.InstallDir.Join("boards.local.txt")
478-
if localProperties, err := properties.SafeLoadFromPath(boardsLocalTxtPath); err == nil {
479-
boardsProperties.Merge(localProperties)
478+
if boardsLocalProperties, err := properties.SafeLoadFromPath(boardsLocalTxtPath); err == nil {
479+
allBoardsProperties.Merge(boardsLocalProperties)
480480
} else {
481481
return err
482482
}
483483

484-
propertiesByBoard := boardsProperties.FirstLevelOf()
485-
484+
propertiesByBoard := allBoardsProperties.FirstLevelOf()
486485
if menus, ok := propertiesByBoard["menu"]; ok {
487486
platform.Menus = menus
488487
} else {
@@ -495,7 +494,7 @@ func (pm *PackageManager) loadBoards(platform *cores.PlatformRelease) error {
495494
skippedBoards := []string{}
496495
for boardID, boardProperties := range propertiesByBoard {
497496
var board *cores.Board
498-
for key := range boardProperties.AsMap() {
497+
for _, key := range boardProperties.Keys() {
499498
if !strings.HasPrefix(key, "menu.") {
500499
continue
501500
}

0 commit comments

Comments
 (0)