mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Simplify convertible check - same type is OK
This is to clarify the code. No actual effect at the moment, but I manually verified this in the case of identical types.
This commit is contained in:
parent
ed59210f04
commit
7fa1e87d66
@ -309,6 +309,9 @@ func isDirectlyConvertible(in, out *types.Type, manualConversions conversionFunc
|
|||||||
return isConvertible(in, out.Underlying, manualConversions)
|
return isConvertible(in, out.Underlying, manualConversions)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if in == out {
|
||||||
|
return true
|
||||||
|
}
|
||||||
if in.Kind != out.Kind {
|
if in.Kind != out.Kind {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -318,12 +321,6 @@ func isDirectlyConvertible(in, out *types.Type, manualConversions conversionFunc
|
|||||||
// We don't support conversion of other types yet.
|
// We don't support conversion of other types yet.
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
switch out.Kind {
|
|
||||||
case types.Builtin, types.Struct, types.Map, types.Slice, types.Pointer:
|
|
||||||
default:
|
|
||||||
// We don't support conversion of other types yet.
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
switch in.Kind {
|
switch in.Kind {
|
||||||
case types.Builtin:
|
case types.Builtin:
|
||||||
|
Loading…
Reference in New Issue
Block a user