Refactor: loop replaced with append()

This commit is contained in:
Bryan Boreham
2017-10-11 09:50:06 +00:00
parent a52c9df48c
commit 5acece6e58
2 changed files with 3 additions and 9 deletions
+1 -3
View File
@@ -104,9 +104,7 @@ function generate_latest_map() {
j++
}
}
for ; j < len(n.entries); j++ {
out = append(out, n.entries[j])
}
out = append(out, n.entries[j:]...)
return ${latest_map_type}{out}
}
+2 -6
View File
@@ -72,9 +72,7 @@ func (m StringLatestMap) Merge(n StringLatestMap) StringLatestMap {
j++
}
}
for ; j < len(n.entries); j++ {
out = append(out, n.entries[j])
}
out = append(out, n.entries[j:]...)
return StringLatestMap{out}
}
@@ -291,9 +289,7 @@ func (m NodeControlDataLatestMap) Merge(n NodeControlDataLatestMap) NodeControlD
j++
}
}
for ; j < len(n.entries); j++ {
out = append(out, n.entries[j])
}
out = append(out, n.entries[j:]...)
return NodeControlDataLatestMap{out}
}