diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-05-19 12:51:12 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-19 12:51:12 -0400 |
commit | 913caaa9b1de2b63692c9bae15120208194c9eb3 (patch) | |
tree | b6b446de9365f1972600484e08322548ffec9b31 /pkg/k8s.io | |
parent | 948c5e915aec709beb4e171a72c7e54504889baf (diff) | |
parent | b22143267bfd114d23ac25b08b71496f79092a91 (diff) | |
download | podman-913caaa9b1de2b63692c9bae15120208194c9eb3.tar.gz podman-913caaa9b1de2b63692c9bae15120208194c9eb3.tar.bz2 podman-913caaa9b1de2b63692c9bae15120208194c9eb3.zip |
Merge pull request #14288 from vrothberg/linters
linter: enable unconvert linter
Diffstat (limited to 'pkg/k8s.io')
-rw-r--r-- | pkg/k8s.io/apimachinery/pkg/api/resource/amount.go | 2 | ||||
-rw-r--r-- | pkg/k8s.io/apimachinery/pkg/api/resource/quantity.go | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/pkg/k8s.io/apimachinery/pkg/api/resource/amount.go b/pkg/k8s.io/apimachinery/pkg/api/resource/amount.go index 9f76f9154..d05984dac 100644 --- a/pkg/k8s.io/apimachinery/pkg/api/resource/amount.go +++ b/pkg/k8s.io/apimachinery/pkg/api/resource/amount.go @@ -221,7 +221,7 @@ func (a int64Amount) AsCanonicalBytes(out []byte) (result []byte, exponent int32 exponent = int32(a.scale) amount, times := removeInt64Factors(mantissa, 10) - exponent += int32(times) + exponent += times // make sure exponent is a multiple of 3 var ok bool diff --git a/pkg/k8s.io/apimachinery/pkg/api/resource/quantity.go b/pkg/k8s.io/apimachinery/pkg/api/resource/quantity.go index 965d2ccaf..dcc5df219 100644 --- a/pkg/k8s.io/apimachinery/pkg/api/resource/quantity.go +++ b/pkg/k8s.io/apimachinery/pkg/api/resource/quantity.go @@ -293,7 +293,7 @@ func ParseQuantity(str string) (Quantity, error) { switch { case exponent >= 0 && len(denom) == 0: // only handle positive binary numbers with the fast path - mantissa = int64(int64(mantissa) << uint64(exponent)) + mantissa <<= uint64(exponent) // 1Mi (2^20) has ~6 digits of decimal precision, so exponent*3/10 -1 is roughly the precision precision = 15 - int32(len(num)) - int32(float32(exponent)*3/10) - 1 default: @@ -313,7 +313,7 @@ func ParseQuantity(str string) (Quantity, error) { if err != nil { return Quantity{}, ErrNumeric } - if result, ok := int64Multiply(value, int64(mantissa)); ok { + if result, ok := int64Multiply(value, mantissa); ok { if !positive { result = -result } |