]> git.baikalelectronics.ru Git - kernel.git/commit
tools/kvm_stat: simplify the sortkey function
authorMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
Tue, 9 Jan 2018 12:27:01 +0000 (13:27 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 24 Feb 2018 00:43:38 +0000 (01:43 +0100)
commit903d16bd030ce83395644aa70a8b3ff68a1a625e
tree412d62ec2b93c59a71bfb2c776d6930a582c3705
parent555acc0572b550b87d729767f172ea88fc9605d4
tools/kvm_stat: simplify the sortkey function

The 'sortkey' function references a value in its enclosing
scope (closure). This is not common practice for a sort key function
so let's replace it. Additionally, the function 'sorted' has already a
parameter for reversing the result therefore the inversion of the
values is unneeded. The check for stats[x][1] is also superfluous as
it's ensured that this value is initialized with 0.

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Tested-by: Stefan Raspl <raspl@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/kvm/kvm_stat/kvm_stat