Clean up virCgroupGetPercpuStats
The iterator is checked for being less than or equal to need_cpus. The 'n' variable is incremented need_cpus + 1 times. Simplify the computation of need_cpus and make its value one larger, to let it be used instead of 'n' and compared without the equal sign in loop conditions. Just index the sum_cpu_time array instead of using a helper variable. Start the loop at start_cpu instead of continuing for all lower values.
Showing
想要评论请 注册 或 登录