Changed the loop as now we are looping over a map and not a slice.

This commit is contained in:
Abhishek Jain 2017-03-23 22:13:29 -04:00
parent 710447cb0d
commit f85ed944f4
2 changed files with 3 additions and 3 deletions

View file

@ -43,7 +43,7 @@ func TasksFromJSON(uri string) ([]Task, error) {
func (tsk *Task) UpdateHost(newHost string) bool { func (tsk *Task) UpdateHost(newHost string) bool {
// Validation // Validation
isCorrectHost := false isCorrectHost := false
for _, existingHost := range constants.Hosts { for existingHost, _ := range constants.Hosts {
if newHost == existingHost { if newHost == existingHost {
isCorrectHost = true isCorrectHost = true
} }

View file

@ -3,6 +3,7 @@ package pcp
import ( import (
"bitbucket.org/sunybingcloud/electron/constants" "bitbucket.org/sunybingcloud/electron/constants"
"bitbucket.org/sunybingcloud/electron/rapl" "bitbucket.org/sunybingcloud/electron/rapl"
"bitbucket.org/sunybingcloud/electron/utilities"
"bufio" "bufio"
"container/ring" "container/ring"
"log" "log"
@ -14,7 +15,6 @@ import (
"strings" "strings"
"syscall" "syscall"
"time" "time"
"bitbucket.org/sunybingcloud/electron/utilities"
) )
func round(num float64) int { func round(num float64) int {
@ -202,7 +202,7 @@ func StartPCPLogAndProgressiveExtremaCap(quit chan struct{}, logging *bool, pref
// If cannot find any victim, then all nodes have been capped to the maximum and we stop capping at this point. // If cannot find any victim, then all nodes have been capped to the maximum and we stop capping at this point.
} }
} }
if (!canCapAlreadyCappedVictim) { if !canCapAlreadyCappedVictim {
log.Println("No Victim left to cap.") log.Println("No Victim left to cap.")
} }
} }