Merge pull request #207 from muesli/conversion-fixes

Avoid unnecessary conversions
This commit is contained in:
Alex Goodman 2019-07-21 15:51:01 -04:00 committed by GitHub
commit 41b5504957
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -199,7 +199,7 @@ func (image *dockerImageAnalyzer) Analyze() (*AnalysisResult, error) {
tree: image.trees[layerIdx], tree: image.trees[layerIdx],
tarPath: manifest.LayerTarPaths[tarPathIdx], tarPath: manifest.LayerTarPaths[tarPathIdx],
} }
image.layers[layerIdx].history.Size = uint64(tree.FileSize) image.layers[layerIdx].history.Size = tree.FileSize
tarPathIdx++ tarPathIdx++
} }
@ -229,7 +229,7 @@ func (image *dockerImageAnalyzer) Analyze() (*AnalysisResult, error) {
UserSizeByes: userSizeBytes, UserSizeByes: userSizeBytes,
SizeBytes: sizeBytes, SizeBytes: sizeBytes,
WastedBytes: wastedBytes, WastedBytes: wastedBytes,
WastedUserPercent: float64(float64(wastedBytes) / float64(userSizeBytes)), WastedUserPercent: float64(wastedBytes) / float64(userSizeBytes),
Inefficiencies: inefficiencies, Inefficiencies: inefficiencies,
}, nil }, nil
} }