mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-17 07:27:22 +00:00
Merge pull request #2524 from Bevisy/main-2264
runtime: Optimize the way slice created
This commit is contained in:
commit
a89cc0bb5c
@ -742,11 +742,7 @@ func (clh *cloudHypervisor) check() error {
|
||||
}
|
||||
|
||||
func (clh *cloudHypervisor) getPids() []int {
|
||||
|
||||
var pids []int
|
||||
pids = append(pids, clh.state.PID)
|
||||
|
||||
return pids
|
||||
return []int{clh.state.PID}
|
||||
}
|
||||
|
||||
func (clh *cloudHypervisor) getVirtioFsPid() *int {
|
||||
|
@ -2280,8 +2280,7 @@ func (q *qemu) getPids() []int {
|
||||
return []int{0}
|
||||
}
|
||||
|
||||
var pids []int
|
||||
pids = append(pids, pid)
|
||||
pids := []int{pid}
|
||||
if q.state.VirtiofsdPid != 0 {
|
||||
pids = append(pids, q.state.VirtiofsdPid)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user