Skip to content

Commit

Permalink
Make if clause simple
Browse files Browse the repository at this point in the history
  • Loading branch information
powerkimhub committed Mar 2, 2025
1 parent 99ce18b commit f65070c
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -496,12 +496,11 @@ func validateCreateDisk(diskReqInfo *irs.DiskInfo, availableDiskTypesInThisZone
if reqDiskCategory == "" || reqDiskCategory == "default" {
for _, diskSizeOfType := range arrRootDiskSizeOfType {
diskSizeArr := strings.Split(diskSizeOfType, "|")
if !ContainString(availableDiskTypesInThisZone, diskSizeArr[0]) { // check available disk type in this zone
continue
if ContainString(availableDiskTypesInThisZone, diskSizeArr[0]) { // check available disk type in this zone
reqDiskCategory = diskSizeArr[0] // ESSD
diskReqInfo.DiskType = reqDiskCategory // set default value
break
}
reqDiskCategory = diskSizeArr[0] // ESSD
diskReqInfo.DiskType = reqDiskCategory // set default value
break
}
}
// 정의된 type인지
Expand All @@ -512,12 +511,11 @@ func validateCreateDisk(diskReqInfo *irs.DiskInfo, availableDiskTypesInThisZone
if diskSize == "" || diskSize == "default" {
for _, diskSizeOfType := range arrRootDiskSizeOfType {
diskSizeArr := strings.Split(diskSizeOfType, "|")
if !ContainString(availableDiskTypesInThisZone, diskSizeArr[0]) { // check available disk type in this zone
continue
if ContainString(availableDiskTypesInThisZone, diskSizeArr[0]) { // check available disk type in this zone
diskSize = diskSizeArr[1] // 20
diskReqInfo.DiskSize = diskSize // set default value
break
}
diskSize = diskSizeArr[1] // 20
diskReqInfo.DiskSize = diskSize // set default value
break
}
}

Expand Down

0 comments on commit f65070c

Please sign in to comment.