Merge pull request #59728 from wgliang/master.append

Automatic merge from submit-queue (batch tested with PRs 59740, 59728, 60080, 60086, 58714). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

more concise to merge the slice

**What this PR does / why we need it**:
more concise to merge the slice

**Special notes for your reviewer**:
This commit is contained in:
Kubernetes Submit Queue
2018-03-19 21:34:30 -07:00
committed by GitHub
6 changed files with 10 additions and 18 deletions

View File

@@ -220,9 +220,7 @@ func (r *ResourceCollector) GetBasicCPUStats(containerName string) map[float64]f
// We must make a copy of array, otherwise the timeseries order is changed.
usages := make([]*framework.ContainerResourceUsage, 0)
for _, usage := range r.buffers[containerName] {
usages = append(usages, usage)
}
usages = append(usages, r.buffers[containerName]...)
sort.Sort(resourceUsageByCPU(usages))
for _, q := range percentiles {