Repository navigation
Commit faa312a
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>1 parent 95e057e commit faa312a
1 file changed
Lines changed: 8 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1080 | 1080 | | |
1081 | 1081 | | |
1082 | 1082 | | |
1083 | | - | |
1084 | | - | |
1085 | | - | |
1086 | | - | |
1087 | | - | |
1088 | | - | |
1089 | | - | |
1090 | | - | |
1091 | | - | |
1092 | | - | |
1093 | | - | |
1094 | 1083 | | |
1095 | 1084 | | |
1096 | 1085 | | |
1097 | 1086 | | |
1098 | 1087 | | |
1099 | | - | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
1100 | 1091 | | |
1101 | | - | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
1102 | 1096 | | |
1103 | | - | |
| 1097 | + | |
1104 | 1098 | | |
1105 | 1099 | | |
1106 | | - | |
1107 | 1100 | | |
1108 | 1101 | | |
1109 | 1102 | | |
| |||
0 commit comments