1
0
mirror of https://github.com/rancher/rke.git synced 2025-08-30 13:02:45 +00:00

fix: fix slice init length (#3695)

This commit is contained in:
cui fliter 2025-02-08 01:19:41 +08:00 committed by GitHub
parent 39323ef1b5
commit 19293428b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -506,8 +506,8 @@ func DeepEqualIPsAltNames(oldIPs, newIPs []net.IP) bool {
if len(oldIPs) != len(newIPs) {
return false
}
oldIPsStrings := make([]string, len(oldIPs))
newIPsStrings := make([]string, len(newIPs))
oldIPsStrings := make([]string, 0, len(oldIPs))
newIPsStrings := make([]string, 0, len(newIPs))
for i := range oldIPs {
oldIPsStrings = append(oldIPsStrings, oldIPs[i].String())
newIPsStrings = append(newIPsStrings, newIPs[i].String())