Explorar o código

Fixed redundant else in GetDeviceStatus

Signed-off-by: Anes Hasicic <anes.hasicic@gmail.com>
Anes Hasicic %!s(int64=10) %!d(string=hai) anos
pai
achega
e479e1c9f7
Modificáronse 1 ficheiros con 7 adicións e 5 borrados
  1. 7 5
      daemon/graphdriver/devmapper/deviceset.go

+ 7 - 5
daemon/graphdriver/devmapper/deviceset.go

@@ -1549,14 +1549,16 @@ func (devices *DeviceSet) GetDeviceStatus(hash string) (*DevStatus, error) {
 		return nil, fmt.Errorf("Error activating devmapper device for '%s': %s", hash, err)
 	}
 
-	if sizeInSectors, mappedSectors, highestMappedSector, err := devices.deviceStatus(info.DevName()); err != nil {
+	sizeInSectors, mappedSectors, highestMappedSector, err := devices.deviceStatus(info.DevName())
+
+	if err != nil {
 		return nil, err
-	} else {
-		status.SizeInSectors = sizeInSectors
-		status.MappedSectors = mappedSectors
-		status.HighestMappedSector = highestMappedSector
 	}
 
+	status.SizeInSectors = sizeInSectors
+	status.MappedSectors = mappedSectors
+	status.HighestMappedSector = highestMappedSector
+
 	return status, nil
 }